diff options
author | Junegunn Choi <junegunn.c@gmail.com> | 2020-03-29 21:26:52 +0900 |
---|---|---|
committer | Junegunn Choi <junegunn.c@gmail.com> | 2020-03-29 21:30:37 +0900 |
commit | 18261fe31cf1270f9aa783f99bbdbca343f89479 (patch) | |
tree | f7301ce7be8c5b80761ceeed6d75669766aea364 /test | |
parent | 079046863c0a9f5bc37d629bab02dccffcf329bc (diff) |
[shell] Update CTRL-R to remove duplicate commands
Close #1940
Related: #1363 #749 #270 #49 #88 #492 #600
Diffstat (limited to 'test')
-rwxr-xr-x | test/test_go.rb | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/test/test_go.rb b/test/test_go.rb index 765108ca..83d189f5 100755 --- a/test/test_go.rb +++ b/test/test_go.rb @@ -1839,15 +1839,18 @@ module TestShell tmux.send_keys 'echo 1st', :Enter; tmux.prepare tmux.send_keys 'echo 2nd', :Enter; tmux.prepare tmux.send_keys 'echo 3d', :Enter; tmux.prepare - tmux.send_keys 'echo 3rd', :Enter; tmux.prepare + 3.times { tmux.send_keys 'echo 3rd', :Enter; tmux.prepare } tmux.send_keys 'echo 4th', :Enter retries do tmux.prepare tmux.send_keys 'C-r' tmux.until { |lines| lines.match_count.positive? } end - tmux.send_keys 'C-r' tmux.send_keys '3d' + # Duplicates removed: 3d (1) + 3rd (1) => 2 matches + tmux.until { |lines| lines.match_count == 2 } + tmux.until { |lines| lines[-3].end_with? 'echo 3d' } + tmux.send_keys 'C-r' tmux.until { |lines| lines[-3].end_with? 'echo 3rd' } tmux.send_keys :Enter tmux.until { |lines| lines[-1] == 'echo 3rd' } |