fzy

terminal fuzzy finder picker

git clone https://9o.is/git/fzy.git

commit 267b16a9f29e14f94d7ec028638929913185206f
parent e525f8bf347fb764d5541224d9daf114e123deda
Author: John Hawthorn <john.hawthorn@gmail.com>
Date:   Tue,  7 Feb 2017 18:17:41 -0800

Add acceptance test for --help

Also shorten help to fit 80 characters wide terminal.

Diffstat:
Msrc/options.c | 2+-
Mtest/acceptance/acceptance_test.rb | 16++++++++++++++++
2 files changed, 17 insertions(+), 1 deletion(-)

diff --git a/src/options.c b/src/options.c @@ -15,7 +15,7 @@ static const char *usage_str = " -e, --show-matches=QUERY Output the sorted matches of QUERY\n" " -t, --tty=TTY Specify file to use as TTY device (default /dev/tty)\n" " -s, --show-scores Show the scores of each match\n" - " -j, --workers NUM Use NUM workers for searching. (default is number of CPU threads)\n" + " -j, --workers NUM Use NUM workers for searching. (default is # of CPUs)\n" " -h, --help Display this help and exit\n" " -v, --version Output version information and exit\n"; diff --git a/test/acceptance/acceptance_test.rb b/test/acceptance/acceptance_test.rb @@ -228,4 +228,20 @@ class FzyTest < Minitest::Test @tty.send_keys("baz") @tty.assert_matches "foo bar baz" end + + def test_help + @tty = TTYtest.new_terminal(%{#{FZY_PATH} --help}) + @tty.assert_matches <<TTY +Usage: fzy [OPTION]... + -l, --lines=LINES Specify how many lines of results to show (default 10) + -p, --prompt=PROMPT Input prompt (default '> ') + -q, --query=QUERY Use QUERY as the initial search string + -e, --show-matches=QUERY Output the sorted matches of QUERY + -t, --tty=TTY Specify file to use as TTY device (default /dev/tty) + -s, --show-scores Show the scores of each match + -j, --workers NUM Use NUM workers for searching. (default is # of CPUs) + -h, --help Display this help and exit + -v, --version Output version information and exit +TTY + end end