summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorSimon Fraser <srfraser@users.noreply.github.com>2019-10-27 14:50:12 +0000
committerJunegunn Choi <junegunn.c@gmail.com>2019-10-27 23:50:12 +0900
commit391669a451c4eedd74dd6e1794601d2ca793340c (patch)
treef028d0e3dc22d1ea036807e330d60e5bf87389c2 /test
parent0c6c76e08115d0ba160e2c95c8692e4174aa5368 (diff)
downloadfzf-391669a451c4eedd74dd6e1794601d2ca793340c.tar.gz
Add 'f' flag for placeholder expression (#1733)
If present the contents of the selection will be placed in a temporary file, and the filename will be placed into the string instead.
Diffstat (limited to 'test')
-rwxr-xr-xtest/test_go.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/test/test_go.rb b/test/test_go.rb
index 4d3fa647..724d847c 100755
--- a/test/test_go.rb
+++ b/test/test_go.rb
@@ -1417,6 +1417,15 @@ class TestGoFZF < TestBase
tmux.until { |lines| lines[1].include?('{//1 10/1 10 /123//0 9}') }
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| lines[1].include?('foo barbar00') }
+ tmux.send_keys :BTab
+ tmux.until { |lines| lines[1].include?('foo barbar00') }
+ tmux.send_keys :BTab
+ tmux.until { |lines| lines[1].include?('foo barbar foobarfoo0101') }
+ end
+
def test_preview_q_no_match
tmux.send_keys %(: | #{FZF} --preview 'echo foo {q}'), :Enter
tmux.until { |lines| lines.match_count == 0 }