summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rwxr-xr-xtest/test_go.rb23
1 files changed, 23 insertions, 0 deletions
diff --git a/test/test_go.rb b/test/test_go.rb
index db2d8f1d..b40bfb42 100755
--- a/test/test_go.rb
+++ b/test/test_go.rb
@@ -3718,6 +3718,29 @@ class TestGoFZF < TestBase
BLOCK
tmux.until { assert_block(block, _1) }
end
+
+ def test_change_nth
+ input = [
+ 'foo bar bar bar bar',
+ 'foo foo bar bar bar',
+ 'foo foo foo bar bar',
+ 'foo foo foo foo bar'
+ ]
+ writelines(input)
+ tmux.send_keys %(#{FZF} -qfoo -n1 --bind 'space:change-nth:2|3|4|5|' < #{tempname}), :Enter
+
+ tmux.until { |lines| assert_equal 4, lines.match_count }
+ tmux.send_keys :Space
+ tmux.until { |lines| assert_equal 3, lines.match_count }
+ tmux.send_keys :Space
+ tmux.until { |lines| assert_equal 2, lines.match_count }
+ tmux.send_keys :Space
+ tmux.until { |lines| assert_equal 1, lines.match_count }
+ tmux.send_keys :Space
+ tmux.until { |lines| assert_equal 0, lines.match_count }
+ tmux.send_keys :Space
+ tmux.until { |lines| assert_equal 4, lines.match_count }
+ end
end
module TestShell