From dcec6354f5e57be1f8420850c3cfd6a56206c67a Mon Sep 17 00:00:00 2001 From: Junegunn Choi Date: Thu, 19 Jun 2025 22:35:23 +0900 Subject: Add {*} placeholder flag --- test/test_preview.rb | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'test/test_preview.rb') diff --git a/test/test_preview.rb b/test/test_preview.rb index 576e36ec..fa05fbcb 100644 --- a/test/test_preview.rb +++ b/test/test_preview.rb @@ -189,6 +189,20 @@ class TestPreview < TestInteractive tmux.until { |lines| assert_includes lines[1], ' {//1 10/1 10 /123//0 9} ' } end + def test_preview_asterisk + tmux.send_keys %(seq 5 | #{FZF} --multi --preview 'echo [{} / {+} / {*}]' --preview-window '+{1}'), :Enter + tmux.until { |lines| assert_equal 5, lines.match_count } + tmux.until { |lines| assert_includes lines[1], ' [1 / 1 / 1 2 3 4 5] ' } + tmux.send_keys :BTab + tmux.until { |lines| assert_includes lines[1], ' [2 / 1 / 1 2 3 4 5] ' } + tmux.send_keys :BTab + tmux.until { |lines| assert_includes lines[1], ' [3 / 1 2 / 1 2 3 4 5] ' } + tmux.send_keys '5' + tmux.until { |lines| assert_includes lines[1], ' [5 / 1 2 / 5] ' } + tmux.send_keys '5' + tmux.until { |lines| assert_includes lines[1], ' [ / 1 2 / ] ' } + end + def test_preview_file tmux.send_keys %[(echo foo bar; echo bar foo) | #{FZF} --multi --preview 'cat {+f} {+f2} {+nf} {+fn}' --print0], :Enter tmux.until { |lines| assert_includes lines[1], ' foo barbar00 ' } -- cgit v1.2.3