summaryrefslogtreecommitdiff
path: root/test/acceptance
diff options
context:
space:
mode:
authorJohn Hawthorn <john.hawthorn@gmail.com>2017-02-07 18:28:21 -0800
committerJohn Hawthorn <john.hawthorn@gmail.com>2017-02-07 18:34:10 -0800
commit0ae974af9639b4df29657cf2fe0033b8808fd728 (patch)
tree4f46a4de1b890d7b9769f00df2d1b2b40df2d6ba /test/acceptance
parent5eba69d32ee76e2ce93a7ce017b6f00b31ee1cbb (diff)
Add Acceptance test large inputs and worker counts
Diffstat (limited to 'test/acceptance')
-rw-r--r--test/acceptance/acceptance_test.rb26
1 files changed, 26 insertions, 0 deletions
diff --git a/test/acceptance/acceptance_test.rb b/test/acceptance/acceptance_test.rb
index 52c9afe..7b6faa8 100644
--- a/test/acceptance/acceptance_test.rb
+++ b/test/acceptance/acceptance_test.rb
@@ -245,6 +245,32 @@ class FzyTest < Minitest::Test
@tty.assert_matches "> f\n#{expected_score} foo"
end
+ def test_large_input
+ @tty = TTYtest.new_terminal(%{seq 100000 | #{FZY_PATH} -l 3})
+ @tty.send_keys('34')
+ @tty.assert_matches "> 34\n34\n340\n341"
+
+ @tty.send_keys('5')
+ @tty.assert_matches "> 345\n345\n3450\n3451"
+
+ @tty.send_keys('z')
+ @tty.assert_matches "> 345z"
+ end
+
+ def test_worker_count
+ @tty = TTYtest.new_terminal(%{echo -n "foo\nbar" | #{FZY_PATH} -j1})
+ @tty.send_keys('foo')
+ @tty.assert_matches "> foo\nfoo"
+
+ @tty = TTYtest.new_terminal(%{seq 100000 | #{FZY_PATH} -j1 -l3})
+ @tty.send_keys('34')
+ @tty.assert_matches "> 34\n34\n340\n341"
+
+ @tty = TTYtest.new_terminal(%{seq 100000 | #{FZY_PATH} -j200 -l3})
+ @tty.send_keys('34')
+ @tty.assert_matches "> 34\n34\n340\n341"
+ end
+
def test_help
@tty = TTYtest.new_terminal(%{#{FZY_PATH} --help})
@tty.assert_matches <<TTY