Skip to content

Commit

Permalink
use realpath to check path equality
Browse files Browse the repository at this point in the history
  • Loading branch information
KristofferC committed Jul 26, 2016
1 parent 4c868b9 commit 7f778e4
Showing 1 changed file with 14 additions and 13 deletions.
27 changes: 14 additions & 13 deletions test/repl.jl
Original file line number Diff line number Diff line change
Expand Up @@ -415,12 +415,12 @@ begin

sendrepl2(cmd) = write(stdin_write,"$cmd\n notify(c)\n")

# Test single statement
# Test removal of prefix in single statement paste
sendrepl2("\e[200~julia> A = 2\e[201~\n")
wait(c)
@test A == 2

# Test multi statement
# Test removal of prefix in multiple statement paste
sendrepl2("""\e[200~
julia> type T17599; a::Int; end
Expand All @@ -436,22 +436,23 @@ begin
@test T17599(3).a == 3
@test !foo(2)

# Test only works in bracket mode
# Test prefix removal only active in bracket paste mode
sendrepl2("julia = 4\n julia> 3 && (A = 1)\n")
wait(c)
@test A == 1

<
# Test shell> mode
tmpdir = mktempdir()
curr_dir = pwd()
write(stdin_write, ";")
write(stdin_write, "\e[200~shell> cd $(escape_string(tmpdir))\e[201~\n")
sendrepl2("tmpdirnow = pwd()")
wait(c)
@test tmpdirnow == tmpdir
cd(curr_dir)
rm(tmpdir)
mktempdir() do tmpdir
curr_dir = pwd()
write(stdin_write, ";")
write(stdin_write, "\e[200~shell> cd $(escape_string(tmpdir))\e[201~\n")
sendrepl2("tmpdirnow = pwd()")
wait(c)
@test tmpdirnow == realpath(tmpdir)
cd(curr_dir)
end

# Close repl
write(stdin_write, '\x04')
wait(repltask)
end
Expand Down

0 comments on commit 7f778e4

Please sign in to comment.