From a6957aba117bac5139f6cd408f1bd1bb89183f8a Mon Sep 17 00:00:00 2001 From: LangLangBart <92653266+LangLangBart@users.noreply.github.com> Date: Tue, 3 Dec 2024 12:34:26 +0100 Subject: chore: completion test command sequence (#4115) cleanup zsh global scope --- test/test_go.rb | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'test') 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'" -- cgit v1.2.3