summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorJunegunn Choi <junegunn.c@gmail.com>2023-04-26 15:13:08 +0900
committerJunegunn Choi <junegunn.c@gmail.com>2023-04-26 15:13:08 +0900
commitcf95e44cb4ce6f42a318abba0efa77c7311c87c9 (patch)
tree58d0c5b9cc50f69485f4450fd71f4a0b5185d736 /test
parent65dd2bb42947d4ede31d160214f3a4c6fdc619e1 (diff)
Add 'zero' event
Close #3263
Diffstat (limited to 'test')
-rwxr-xr-xtest/test_go.rb10
1 files changed, 8 insertions, 2 deletions
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