m/fzf
1
0
mirror of https://github.com/junegunn/fzf.git synced 2025-11-18 00:03:39 -05:00

Add 'one' event

Close #2629
Close #2494
Close #459
This commit is contained in:
Junegunn Choi
2023-04-01 17:16:02 +09:00
parent 1c7534f009
commit 8ec917b1c3
6 changed files with 39 additions and 0 deletions

View File

@@ -2702,6 +2702,20 @@ class TestGoFZF < TestBase
assert_equal '> 555', lines[index]
end
end
def test_one
tmux.send_keys "seq 10 | #{FZF} --bind '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') }
end
tmux.send_keys '0'
tmux.until do |lines|
assert_equal 1, lines.match_count
assert lines.any? { _1.include?('only match') }
end
end
end
module TestShell