Skip to content

Commit

Permalink
add tests for prompt timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
IanButterworth committed Apr 4, 2021
1 parent 497c4b4 commit 782c1ac
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions test/misc.jl
Original file line number Diff line number Diff line change
Expand Up @@ -516,6 +516,10 @@ let buf = IOBuffer()
@test Base.prompt(IOBuffer("\n"), buf, "baz", default="foobar") == "foobar"
@test String(take!(buf)) == "baz [foobar]: "
@test Base.prompt(IOBuffer("blah\n"), buf, "baz", default="foobar") == "blah"
take!(buf)
# prompt timeout
@test Base.prompt(stdin, buf, "baz", default="foobar", timeout = 1) == "foobar"
@test String(take!(buf)) == "baz [foobar] timeout 1 second: timed out\n"
end

# these tests are not in a test block so that they will compile separately
Expand Down

0 comments on commit 782c1ac

Please sign in to comment.