summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorLangLangBart <92653266+LangLangBart@users.noreply.github.com>2024-12-03 12:34:26 +0100
committerGitHub <noreply@github.com>2024-12-03 20:34:26 +0900
commita6957aba117bac5139f6cd408f1bd1bb89183f8a (patch)
tree930ec5ec8f79c5f38971812653c2e6c117f6a437 /test
parentb5f94f961dbf9e5d12b7ac5a5b514d12be89cb97 (diff)
downloadfzf-a6957aba117bac5139f6cd408f1bd1bb89183f8a.tar.gz
chore: completion test command sequence (#4115)
cleanup zsh global scope
Diffstat (limited to 'test')
-rwxr-xr-xtest/test_go.rb17
1 files changed, 17 insertions, 0 deletions
diff --git a/test/test_go.rb b/test/test_go.rb
index ff63c90f..433fdef3 100755
--- a/test/test_go.rb
+++ b/test/test_go.rb
@@ -3737,6 +3737,23 @@ module CompletionTest
tmux.until { |lines| assert_equal 'unset FZFFOOBAR', lines[-1] }
end
+ def test_completion_in_command_sequence
+ tmux.send_keys 'export FZFFOOBAR=BAZ', :Enter
+ tmux.prepare
+
+ triggers = ['**', '~~', '++', 'ff', '/']
+ triggers.concat(['&', '[', ';', '`']) if instance_of?(TestZsh)
+
+ triggers.each do |trigger|
+ set_var('FZF_COMPLETION_TRIGGER', trigger)
+ command = "echo foo; QUX=THUD unset FZFFOOBR#{trigger}"
+ tmux.send_keys command.sub(/(;|`)$/, '\\\\\1'), :Tab
+ tmux.until { |lines| assert_equal 1, lines.match_count }
+ tmux.send_keys :Enter
+ tmux.until { |lines| assert_equal 'echo foo; QUX=THUD unset FZFFOOBAR', lines[-1] }
+ end
+ end
+
def test_file_completion_unicode
FileUtils.mkdir_p('/tmp/fzf-test')
tmux.paste "cd /tmp/fzf-test; echo test3 > $'fzf-unicode \\355\\205\\214\\354\\212\\244\\355\\212\\2701'; echo test4 > $'fzf-unicode \\355\\205\\214\\354\\212\\244\\355\\212\\2702'"