fzy

terminal fuzzy finder picker

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

commit c42f316b62f9be45d6d4997e2e81debaa16781f7
parent 9d1c8fb2f5547874cd9d2549b0c3a973ba402c0a
Author: John Hawthorn <john@hawthorn.email>
Date:   Sun,  9 Sep 2018 13:31:40 -0700

Fix acceptance tests

Diffstat:
Mtest/acceptance/acceptance_test.rb | 8++++++--
1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/test/acceptance/acceptance_test.rb b/test/acceptance/acceptance_test.rb @@ -328,7 +328,11 @@ class FzyTest < Minitest::Test # 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 = TTYtest.new_terminal(%{(sleep 0.5; echo aa; echo bc; echo bd) | #{FZY_PATH}}) + + # Before input has all come in, but wait for fzy to at least start + sleep 0.1 + @tty.send_keys("b\r") @tty.assert_matches "bc" end @@ -463,7 +467,7 @@ TTY def interactive_fzy(input: [], before: nil, after: nil, args: "") cmd = [] cmd << %{echo "#{before}"} if before - cmd << %{echo -n "#{input.join("\\n")}" | #{FZY_PATH} #{args}} + cmd << %{printf "#{input.join("\\n")}" | #{FZY_PATH} #{args}} cmd << %{echo "#{after}"} if after cmd = cmd.join("; ") TTYtest.new_terminal(cmd)