Skip to content

Commit

Permalink
Prevent repl tests from hanging if homedir() is a symlink
Browse files Browse the repository at this point in the history
I am testing julia on a machine where my home directory is a
symlink.  Unfortunately, this means the repl tests hang, as they
wait for the homedir to be given at the shell prompt, but instead
the pwd() is printed.  `pwd()` calls `uv_cwd()` which calls
`getcwd()`, which [will always resolve symbolic links](https://stackoverflow.com/a/1545838/1558890),
thus printing something other than `homedir()` on my system.
This changes the repl tests to wait for `realpath(homedir())`
instead of `homedir()`.
  • Loading branch information
garrison committed Sep 9, 2016
1 parent f141c16 commit f26aee2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions test/repl.jl
Original file line number Diff line number Diff line change
Expand Up @@ -86,10 +86,10 @@ if !is_windows() || Sys.windows_version() >= Sys.WINDOWS_VISTA_VER
write(stdin_write, ";")
readuntil(stdout_read, "shell> ")
write(stdin_write, "cd\n")
readuntil(stdout_read, homedir()[max(1,end-39):end])
readuntil(stdout_read, realpath(homedir())[max(1,end-39):end])
readuntil(stdout_read, "\n")
readuntil(stdout_read, "\n")
@test pwd() == homedir()
@test pwd() == realpath(homedir())
end
cd(origpwd)

Expand Down

0 comments on commit f26aee2

Please sign in to comment.