Fix test case

This commit is contained in:
Junegunn Choi 2025-01-27 18:12:25 +09:00
parent a2aa1a156c
commit af7940746f
No known key found for this signature in database
GPG Key ID: 254BC280FEF9C627

View File

@ -209,9 +209,11 @@ class TestPreview < TestInteractive
end
def test_preview_q_no_match_with_initial_query
tmux.send_keys %(: | #{FZF} --preview 'echo foo {q}/{q}/{q:1}/{q:..}/{q:2}/{q:-1}/{q:-2}/{q:x}' --query 'foo bar'), :Enter
tmux.send_keys %(: | #{FZF} --preview 'echo 1. /{q}/{q:1}/; echo 2. /{q:..}/{q:2}/{q:-1}/; echo 3. /{q:s-2}/{q:-2}/{q:x}/' --query 'foo bar'), :Enter
tmux.until { |lines| assert_equal 0, lines.match_count }
tmux.until { |lines| assert_includes lines[1], ' foo bar/foo bar/foo/foo bar/bar/bar/foo/{q:x} ' }
tmux.until { |lines| assert_includes lines[1], '1. /foo bar/foo/' }
tmux.until { |lines| assert_includes lines[2], '2. /foo bar/bar/bar/' }
tmux.until { |lines| assert_includes lines[3], '3. /foo /foo/{q:x}/' }
end
def test_preview_update_on_select