fzy

terminal fuzzy finder picker

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

commit 5d62062b5611cf4a1d86f7ee28c89a1ee91a1936
parent 267b16a9f29e14f94d7ec028638929913185206f
Author: John Hawthorn <john.hawthorn@gmail.com>
Date:   Tue,  7 Feb 2017 18:21:44 -0800

Add acceptance test for --show-scores

Diffstat:
Mtest/acceptance/acceptance_test.rb | 16++++++++++++++++
1 file changed, 16 insertions(+), 0 deletions(-)

diff --git a/test/acceptance/acceptance_test.rb b/test/acceptance/acceptance_test.rb @@ -229,6 +229,22 @@ class FzyTest < Minitest::Test @tty.assert_matches "foo bar baz" end + def test_show_scores + expected_score = '( inf)' + @tty = TTYtest.new_terminal(%{echo -n "foo\nbar" | #{FZY_PATH} -s}) + @tty.send_keys('foo') + @tty.assert_matches "> foo\n#{expected_score} foo" + + @tty = TTYtest.new_terminal(%{echo -n "foo\nbar" | #{FZY_PATH} --show-scores}) + @tty.send_keys('foo') + @tty.assert_matches "> foo\n#{expected_score} foo" + + expected_score = '( 0.89)' + @tty = TTYtest.new_terminal(%{echo -n "foo\nbar" | #{FZY_PATH} -s}) + @tty.send_keys('f') + @tty.assert_matches "> f\n#{expected_score} foo" + end + def test_help @tty = TTYtest.new_terminal(%{#{FZY_PATH} --help}) @tty.assert_matches <<TTY