From 782c1acde9bcb3dbceffa7ad1a4f8a8b64934146 Mon Sep 17 00:00:00 2001 From: Ian Date: Sun, 4 Apr 2021 15:10:39 -0400 Subject: [PATCH] add tests for prompt timeout --- test/misc.jl | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/test/misc.jl b/test/misc.jl index 2305b78250ef21..ad03f451184021 100644 --- a/test/misc.jl +++ b/test/misc.jl @@ -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