diff options
author | Junegunn Choi <junegunn.c@gmail.com> | 2015-04-14 02:00:50 +0900 |
---|---|---|
committer | Junegunn Choi <junegunn.c@gmail.com> | 2015-04-14 02:00:50 +0900 |
commit | 91fc6c984b8b8eaf793afc778efaa624c7c35527 (patch) | |
tree | fd729e5f7f990c50bd06a44293d0060338f118cf /test | |
parent | a4f3d09704364b6c1c496fa465cc4dc594f44159 (diff) |
Fix fuzzy completion test
Diffstat (limited to 'test')
-rw-r--r-- | test/test_go.rb | 31 |
1 files changed, 19 insertions, 12 deletions
diff --git a/test/test_go.rb b/test/test_go.rb index ebedbff2..94093ff1 100644 --- a/test/test_go.rb +++ b/test/test_go.rb @@ -546,25 +546,29 @@ class TestBash < TestBase def test_file_completion tmux.send_keys 'mkdir -p /tmp/fzf-test; touch /tmp/fzf-test/{1..100}', :Enter tmux.prepare - tmux.send_keys 'cat /tmp/fzf-test/10**', :Tab - tmux.until { |lines| lines[-1].start_with? '>' } + tmux.send_keys 'cat /tmp/fzf-test/10**', :Tab, pane: 0 + tmux.until(pane: 1) { |lines| lines[-1].start_with? '>' } tmux.send_keys :BTab, :BTab, :Enter - tmux.until { |lines| + tmux.until do |lines| + tmux.send_keys 'C-L' lines[-1].include?('/tmp/fzf-test/10') && lines[-1].include?('/tmp/fzf-test/100') - } + end end def test_dir_completion tmux.send_keys 'mkdir -p /tmp/fzf-test/d{1..100}; touch /tmp/fzf-test/d55/xxx', :Enter tmux.prepare - tmux.send_keys 'cd /tmp/fzf-test/**', :Tab - tmux.until { |lines| lines[-1].start_with? '>' } + tmux.send_keys 'cd /tmp/fzf-test/**', :Tab, pane: 0 + tmux.until(pane: 1) { |lines| lines[-1].start_with? '>' } tmux.send_keys :BTab, :BTab # BTab does not work here tmux.send_keys 55 - tmux.until { |lines| lines[-2].start_with? ' 1/' } + tmux.until(pane: 1) { |lines| lines[-2].start_with? ' 1/' } tmux.send_keys :Enter - tmux.until { |lines| lines[-1] == 'cd /tmp/fzf-test/d55/' } + tmux.until do |lines| + tmux.send_keys 'C-L' + lines[-1] == 'cd /tmp/fzf-test/d55/' + end tmux.send_keys :xx tmux.until { |lines| lines[-1] == 'cd /tmp/fzf-test/d55/xx' } @@ -584,12 +588,15 @@ class TestBash < TestBase lines = tmux.until { |lines| lines[-1].start_with? '[1]' } pid = lines[-1].split.last tmux.prepare - tmux.send_keys 'kill ', :Tab - tmux.until { |lines| lines[-1].start_with? '>' } + tmux.send_keys 'kill ', :Tab, pane: 0 + tmux.until(pane: 1) { |lines| lines[-1].start_with? '>' } tmux.send_keys 'sleep12345' - tmux.until { |lines| lines[-3].include? 'sleep 12345' } + tmux.until(pane: 1) { |lines| lines[-3].include? 'sleep 12345' } tmux.send_keys :Enter - tmux.until { |lines| lines[-1] == "kill #{pid}" } + tmux.until do |lines| + tmux.send_keys 'C-L' + lines[-1] == "kill #{pid}" + end end end |