v/slow_tests/repl: use real path of test folder for repl tests #20007
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When running
v vlib/v/slow_tests/repl/repl_test.v
, test 9 would fail. On one of my machines,/home
is a symlink to/usr/home
so my home directory/home/kim
has a real path of/usr/home/kim
.The problem is that the test folder has the
/home/kim
prefix and when this value is removed from the result messages returned from a test, the/usr
part is still in the error message and therefore it doesn't match the expected output. Lines 61-62 invlib/v/slow_tests/repl/runner/runner.v
remove the working directory from the error messages and without using the real path of tfolder, it does not work properly when the path to tfolder has a symlink in it.🤖[deprecated] Generated by Copilot at ef06cfd
Fix some REPL tests on Windows by using real paths for temporary folders. Make
tfolder
mutable and assign it the result ofos.real_path
invlib/v/slow_tests/repl/repl_test.v
.🤖[deprecated] Generated by Copilot at ef06cfd
tfolder
mutable and assign it the real path of the created folder to avoid potential issues with symbolic links or relative paths when running the REPL tests on Windows (link)