From cf95e44cb4ce6f42a318abba0efa77c7311c87c9 Mon Sep 17 00:00:00 2001 From: Junegunn Choi Date: Wed, 26 Apr 2023 15:13:08 +0900 Subject: Add 'zero' event Close #3263 --- test/test_go.rb | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'test') diff --git a/test/test_go.rb b/test/test_go.rb index fc0b9e04..7cdacdef 100755 --- a/test/test_go.rb +++ b/test/test_go.rb @@ -2835,18 +2835,24 @@ class TestGoFZF < TestBase end end - def test_one - tmux.send_keys "seq 10 | #{FZF} --bind 'one:preview:echo {} is the only match'", :Enter + def test_one_and_zero + tmux.send_keys "seq 10 | #{FZF} --bind 'zero:preview(echo no match),one:preview(echo {} is the only match)'", :Enter tmux.send_keys '1' tmux.until do |lines| assert_equal 2, lines.match_count refute(lines.any? { _1.include?('only match') }) + refute(lines.any? { _1.include?('no match') }) end tmux.send_keys '0' tmux.until do |lines| assert_equal 1, lines.match_count assert(lines.any? { _1.include?('only match') }) end + tmux.send_keys '0' + tmux.until do |lines| + assert_equal 0, lines.match_count + assert(lines.any? { _1.include?('no match') }) + end end def test_height_range_with_exit_0 -- cgit v1.2.3