diff options
author | Junegunn Choi <junegunn.c@gmail.com> | 2020-02-29 11:54:05 +0900 |
---|---|---|
committer | Junegunn Choi <junegunn.c@gmail.com> | 2020-02-29 12:01:55 +0900 |
commit | b2c0413a98e210cedd34fbe0f6ba051906da398f (patch) | |
tree | bd1013f3ecfb0165b6bc8cad89d253cb642f3517 /test | |
parent | e34c7c00b1df84085c6ade0380409bce61793a12 (diff) |
[bash] Fix --query argument of CTRL-R
Fix #1898
Diffstat (limited to 'test')
-rwxr-xr-x | test/test_go.rb | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/test/test_go.rb b/test/test_go.rb index aa1589ca..7c448fe1 100755 --- a/test/test_go.rb +++ b/test/test_go.rb @@ -1853,12 +1853,15 @@ module TestShell def test_ctrl_r_abort skip "doesn't restore the original line when search is aborted pre Bash 4" if shell == :bash && /(?<= version )\d+/.match(`#{Shell.bash} --version`).to_s.to_i < 4 - tmux.send_keys 'foo' - tmux.until { |lines| lines[-1].start_with? 'foo' } - tmux.send_keys 'C-r' - tmux.until { |lines| lines[-1].start_with? '>' } - tmux.send_keys 'C-g' - tmux.until { |lines| lines[-1].start_with? 'foo' } + %w[foo ' "].each do |query| + tmux.prepare + tmux.send_keys(query) + tmux.until { |lines| lines[-1].start_with? query } + tmux.send_keys 'C-r' + tmux.until { |lines| lines[-1] == "> #{query}" } + tmux.send_keys 'C-g' + tmux.until { |lines| lines[-1].start_with? query } + end end def retries(times = 3) |