From a89d8995c3a4544851ae3a40b8fb1f1c16f9535e Mon Sep 17 00:00:00 2001 From: Junegunn Choi Date: Mon, 9 Nov 2015 01:42:01 +0900 Subject: Add execute-multi action Close #413 --- test/test_go.rb | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'test') diff --git a/test/test_go.rb b/test/test_go.rb index 7143d369..e3b52747 100644 --- a/test/test_go.rb +++ b/test/test_go.rb @@ -713,6 +713,24 @@ class TestGoFZF < TestBase File.unlink output rescue nil end + def test_execute_multi + output = '/tmp/fzf-test-execute-multi' + opts = %[--multi --bind \\"alt-a:execute-multi(echo '[{}], @{}@' >> #{output})\\"] + tmux.send_keys "seq 100 | #{fzf opts}", :Enter + tmux.until { |lines| lines[-2].include? '100/100' } + tmux.send_keys :Escape, :a + tmux.send_keys :BTab, :BTab, :BTab + tmux.send_keys :Escape, :a + tmux.send_keys :Tab, :Tab + tmux.send_keys :Escape, :a + tmux.send_keys :Enter + readonce + assert_equal ['["1"], @"1"@', '["1" "2" "3"], @"1" "2" "3"@', '["1" "2" "4"], @"1" "2" "4"@'], + File.readlines(output).map(&:chomp) + ensure + File.unlink output rescue nil + end + def test_cycle tmux.send_keys "seq 8 | #{fzf :cycle}", :Enter tmux.until { |lines| lines[-2].include? '8/8' } -- cgit v1.2.3