summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Hawthorn <john@hawthorn.email>2018-06-17 11:48:06 -0700
committerJohn Hawthorn <john@hawthorn.email>2018-06-17 12:22:44 -0700
commit794dc0c06cfc1ea60cf97d98c65bb14b47aa3a69 (patch)
tree8b9c6d84e05e2aa8ddb67a0db1afa422109b6599
parenta0e259f93664a6ee8030da8f2b57027753793d3e (diff)
Add test for user input coming before choices read
-rw-r--r--test/acceptance/acceptance_test.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/test/acceptance/acceptance_test.rb b/test/acceptance/acceptance_test.rb
index 4a11cac..cac4c26 100644
--- a/test/acceptance/acceptance_test.rb
+++ b/test/acceptance/acceptance_test.rb
@@ -320,6 +320,13 @@ class FzyTest < Minitest::Test
@tty.assert_matches "> foo\nfoo"
end
+ # https://github.com/jhawthorn/fzy/issues/81
+ def test_slow_stdin_fast_user
+ @tty = TTYtest.new_terminal(%{(echo aa; echo bc; echo bd; sleep 0.5) | #{FZY_PATH}})
+ @tty.send_keys("b\r")
+ @tty.assert_matches "bc"
+ end
+
def test_help
@tty = TTYtest.new_terminal(%{#{FZY_PATH} --help})
@tty.assert_matches <<TTY