Skip to content
Myr

[test] Use tmux buffer in unicode test cases

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

Related #616

authored by Junegunn Choi · committed by Junegunn Choi · parent 6081eac · Browse files · 1 file+8 added−3 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+8 added−3 removed

  • tests:+8 added−3 removed

1 file+8 added−3 removed

modified:test/test_go.rb+8 added-3 removed
88 unmodified lines
89 args = args.map { |a| %{"#{a}"} }.join ' '90 go("send-keys -t #{target} #{args}")91 end9293 def paste str94 %x[tmux setb '#{str.gsub("'", "'\\''")}' \\; pasteb -t #{win} \\; send-keys -t #{win} Enter]95 end9697 def capture pane = 098 File.unlink TEMPNAME while File.exists? TEMPNAME99 wait do100 go("capture-pane -t #{win}.#{pane} \\; save-buffer #{TEMPNAME} 2> /dev/null")
264 unmodified lines
365 end366 end367368 def test_query_unicode365 tmux.send_keys "(echo abc; echo 가나다) | #{fzf :query, '가다'}", :Enter369 tmux.paste "(echo abc; echo 가나다) | #{fzf :query, '가다'}"370 tmux.until { |lines| lines[-2].include? '1/2' }371 tmux.send_keys :Enter372 assert_equal ['가나다'], readonce.split($/)373 end
942 unmodified lines
1316 end13171318 def test_ctrl_t_unicode1319 FileUtils.mkdir_p '/tmp/fzf-test'1316 tmux.send_keys 'cd /tmp/fzf-test; echo -n test1 > "fzf-unicode 테스트1"; echo -n test2 > "fzf-unicode 테스트2"', :Enter1320 tmux.paste 'cd /tmp/fzf-test; echo -n test1 > "fzf-unicode 테스트1"; echo -n test2 > "fzf-unicode 테스트2"'1321 tmux.prepare1322 tmux.send_keys 'cat ', 'C-t', pane: 01323 tmux.until(1) { |lines| lines.item_count >= 1 }1324 tmux.send_keys 'fzf-unicode', pane: 1
1 unmodified line
1326 tmux.send_keys :BTab, :BTab, pane: 11327 tmux.until(1) { |lines| lines[-2].include? '(2)' }1328 tmux.send_keys :Enter, pane: 11329 tmux.until { |lines| lines[-1].include?('cat') || lines[-2].include?('cat') }1330 tmux.until { |lines| lines[-1].include?('fzf-unicode') || lines[-2].include?('fzf-unicode') }1331 tmux.send_keys :Enter1332 tmux.until { |lines| lines[-1].include? 'test1test2' }1333 end1334
199 unmodified lines
1534 end15351536 def test_file_completion_unicode1537 FileUtils.mkdir_p '/tmp/fzf-test'1533 tmux.send_keys 'cd /tmp/fzf-test; echo -n test3 > "fzf-unicode 테스트1"; echo -n test4 > "fzf-unicode 테스트2"', :Enter1538 tmux.paste 'cd /tmp/fzf-test; echo -n test3 > "fzf-unicode 테스트1"; echo -n test4 > "fzf-unicode 테스트2"'1539 tmux.prepare1540 tmux.send_keys 'cat fzf-unicode**', :Tab, pane: 01541 tmux.until(1) { |lines| lines[-2].start_with? ' 2/' }1542 tmux.send_keys :BTab, :BTab, pane: 1
60 unmodified lines