From 18261fe31cf1270f9aa783f99bbdbca343f89479 Mon Sep 17 00:00:00 2001 From: Junegunn Choi Date: Sun, 29 Mar 2020 21:26:52 +0900 Subject: [shell] Update CTRL-R to remove duplicate commands Close #1940 Related: #1363 #749 #270 #49 #88 #492 #600 --- test/test_go.rb | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'test') 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' } -- cgit v1.2.3