summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorTimofei Bredov <12125537+rebrendov@users.noreply.github.com>2023-09-17 18:15:04 +0300
committerGitHub <noreply@github.com>2023-09-18 00:15:04 +0900
commitedfdcc8cee31e227a5f7eda9c1faa4893757645c (patch)
treebc608c1a782057a87a0fec09c9597038d475b646 /test
parent3982c9a552c7000bf1e4dbc667291bb6e64b4228 (diff)
Basic context-aware completion for ssh command (#3424)
Co-authored-by: Junegunn Choi <junegunn.c@gmail.com>
Diffstat (limited to 'test')
-rwxr-xr-xtest/test_go.rb28
1 files changed, 28 insertions, 0 deletions
diff --git a/test/test_go.rb b/test/test_go.rb
index c192835e..12e53471 100755
--- a/test/test_go.rb
+++ b/test/test_go.rb
@@ -3365,6 +3365,34 @@ module CompletionTest
tmux.prepare
tmux.send_keys 'unset -f _fzf_comprun', :Enter
end
+
+ def test_ssh_completion
+ (1..5).each { |i| FileUtils.touch("/tmp/fzf-test-ssh-#{i}") }
+
+ tmux.send_keys 'ssh jg@localhost**', :Tab
+ tmux.until do |lines|
+ assert lines.match_count >= 1
+ end
+
+ tmux.send_keys :Enter
+ tmux.until { |lines| assert lines.any_include?('ssh jg@localhost') }
+ tmux.send_keys ' -i /tmp/fzf-test-ssh**', :Tab
+ tmux.until do |lines|
+ assert lines.match_count >= 5
+ assert_equal 0, lines.select_count
+ end
+ tmux.send_keys :Tab, :Tab, :Tab
+ tmux.until do |lines|
+ assert_equal 3, lines.select_count
+ end
+ tmux.send_keys :Enter
+ tmux.until { |lines| assert lines.any_include?('ssh jg@localhost -i /tmp/fzf-test-ssh-') }
+
+ tmux.send_keys 'localhost**', :Tab
+ tmux.until do |lines|
+ assert lines.match_count >= 1
+ end
+ end
end
class TestBash < TestBase