Skip to content

Commit

Permalink
added test for cd feature in REPL shell mode
Browse files Browse the repository at this point in the history
  • Loading branch information
garrison committed Nov 29, 2014
1 parent e053ac2 commit a4dded4
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions test/repl.jl
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,28 @@ write(stdin_write, '\x03')
write(stdin_write, "\\alpha\t")
readuntil(stdout_read,"α")
write(stdin_write, '\x03')
# Test cd feature in shell mode
origpwd = pwd()
tmpdir = mktempdir()
write(stdin_write, ";")
readuntil(stdout_read, "shell> ")
write(stdin_write, "cd $(tmpdir)\n")
readuntil(stdout_read, "\n")
readuntil(stdout_read, "\n")
@test pwd() != origpwd
write(stdin_write, ";")
readuntil(stdout_read, "shell> ")
write(stdin_write, "cd -\n")
readuntil(stdout_read, "\n")
readuntil(stdout_read, "\n")
@test pwd() == origpwd
write(stdin_write, ";")
readuntil(stdout_read, "shell> ")
write(stdin_write, "cd\n")
readuntil(stdout_read, "\n")
readuntil(stdout_read, "\n")
@test pwd() == homedir()
rm(tmpdir)
# Close REPL ^D
write(stdin_write, '\x04')
wait(repltask)
Expand Down

0 comments on commit a4dded4

Please sign in to comment.