Skip to content
Myr

test(zsh): check capture for fzf exit status in widget

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by LangLangBart · committed by Junegunn Choi · parent 0efef29 · Browse files · 1 file+14 added−0 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+14 added−0 removed

  • tests:+14 added−0 removed

1 file+14 added−0 removed

modified:test/test_shell_integration.rb+14 added
997 unmodified lines
998 tmux.prepare999 tmux.send_keys 'C-l', 'C-r'1000 end10011002 test_perl_and_awk 'ctrl_r_exit_code' do1003 exit_file = "#{tempname}-exit"1004 # Wrapper captures status, as widgets return values don't propagate to "$?"1005 # A non-zero status causes the shell to beep when the widget exits (man zshzle)1006 tmux.send_keys %(f() { zle fzf-history-widget; echo $? > #{exit_file}; zle reset-prompt } && zle -N f && bindkey "^R" f), :Enter1007 prepare_ctrl_r_test1008 tmux.until { |lines| assert_operator lines.match_count, :>, 0 }1009 tmux.send_keys 'C-g' # abort1010 tmux.send_keys "cat #{exit_file}", :Enter1011 tmux.until { |lines| assert_equal '130', lines[-1] }1012 ensure1013 FileUtils.rm_f(exit_file)1014 end10151016 test_perl_and_awk 'ctrl_r_accept_or_print_query' do1017 set_var('FZF_CTRL_R_OPTS', '--bind enter:accept-or-print-query')1018 prepare_ctrl_r_test1019 tmux.until { |lines| assert_operator lines.match_count, :>, 0 }
261 unmodified lines