summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorJohn Hawthorn <john@hawthorn.email>2019-12-27 23:18:16 -0800
committerJohn Hawthorn <john@hawthorn.email>2019-12-27 23:18:16 -0800
commit28195b3a709995354b6c33cec9bb7c9f81532eb6 (patch)
treefbfd61fb82d8212284f5d5a0319ff3a8ec2b82d1 /test
parent04c342cd0bbff6f9a790ba1f3abc79517bbec096 (diff)
parent8505df59ffd9b578f98591520b51abc818509fc3 (diff)
Merge branch 'show-info'
Diffstat (limited to 'test')
-rw-r--r--test/acceptance/acceptance_test.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/acceptance/acceptance_test.rb b/test/acceptance/acceptance_test.rb
index ba3ec01..13af803 100644
--- a/test/acceptance/acceptance_test.rb
+++ b/test/acceptance/acceptance_test.rb
@@ -1,3 +1,4 @@
+# coding: utf-8
require 'minitest'
require 'minitest/autorun'
require 'ttytest'
@@ -446,6 +447,15 @@ class FzyTest < Minitest::Test
TTY
end
+ def test_show_info
+ @tty = interactive_fzy(input: %w[foo bar baz], args: "-i")
+ @tty.assert_matches ">\n[3/3]\nfoo\nbar\nbaz"
+ @tty.send_keys("ba")
+ @tty.assert_matches "> ba\n[2/3]\nbar\nbaz"
+ @tty.send_keys("q")
+ @tty.assert_matches "> baq\n[0/3]"
+ end
+
def test_help
@tty = TTYtest.new_terminal(%{#{FZY_PATH} --help})
@tty.assert_matches <<TTY
@@ -458,6 +468,7 @@ Usage: fzy [OPTION]...
-s, --show-scores Show the scores of each match
-0, --read-null Read input delimited by ASCII NUL characters
-j, --workers NUM Use NUM workers for searching. (default is # of CPUs)
+ -i, --show-info Show selection info line
-h, --help Display this help and exit
-v, --version Output version information and exit
TTY