From b8fc828955176f18a94630f2ad4d28c54aa6c927 Mon Sep 17 00:00:00 2001 From: Junegunn Choi Date: Wed, 11 Mar 2020 19:42:17 +0900 Subject: [PATCH] Fix completion test --- test/test_go.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/test/test_go.rb b/test/test_go.rb index 9bacb8ba..c640e2fb 100755 --- a/test/test_go.rb +++ b/test/test_go.rb @@ -2066,6 +2066,7 @@ module CompletionTest end def test_custom_completion_api + tmux.send_keys 'eval "_fzf$(declare -f _comprun)"', :Enter %w[f g].each do |command| tmux.prepare tmux.send_keys "#{command} b**", :Tab @@ -2078,6 +2079,9 @@ module CompletionTest tmux.until { |lines| lines[-1].include?("#{command} #{command}barbar") } tmux.send_keys 'C-u' end + ensure + tmux.prepare + tmux.send_keys 'unset -f _fzf_comprun', :Enter end end @@ -2192,7 +2196,7 @@ _fzf_complete_g_post() { [ -n "$BASH" ] && complete -F _fzf_complete_f -o default -o bashdefault f [ -n "$BASH" ] && complete -F _fzf_complete_g -o default -o bashdefault g -_fzf_comprun() { +_comprun() { local command=$1 shift