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

An '--expect' key should execute actions bound to the key

Fix #3810
This commit is contained in:
Junegunn Choi
2024-05-22 20:39:09 +09:00
parent 552158f3ad
commit 6b4358f641
2 changed files with 19 additions and 8 deletions

View File

@@ -580,6 +580,13 @@ class TestGoFZF < TestBase
test.call('@', '@')
end
def test_expect_with_bound_actions
tmux.send_keys "seq 1 100 | #{fzf('--query 1 --print-query --expect z --bind z:up+up')}", :Enter
tmux.until { |lines| assert_equal 20, lines.match_count }
tmux.send_keys('z')
assert_equal %w[1 z 11], readonce.lines(chomp: true)
end
def test_expect_print_query
tmux.send_keys "seq 1 100 | #{fzf('--expect=alt-z', :print_query)}", :Enter
tmux.until { |lines| assert_equal ' 100/100', lines[-2] }