summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorJunegunn Choi <junegunn.c@gmail.com>2016-07-10 12:27:01 +0900
committerJunegunn Choi <junegunn.c@gmail.com>2016-07-10 12:27:01 +0900
commit05299a0fee32cb714f57a4f472412e63286e5d99 (patch)
tree13fc5e119b897c573588f1ce638db731df91c625 /test
parent6081eac58a0c1fe7cf920dc41d7d6ec07293b0ee (diff)
[test] Use tmux buffer in unicode test cases
Related #616
Diffstat (limited to 'test')
-rw-r--r--test/test_go.rb11
1 files changed, 8 insertions, 3 deletions
diff --git a/test/test_go.rb b/test/test_go.rb
index c375fac1..b2c52c17 100644
--- a/test/test_go.rb
+++ b/test/test_go.rb
@@ -90,6 +90,10 @@ class Tmux
go("send-keys -t #{target} #{args}")
end
+ def paste str
+ %x[tmux setb '#{str.gsub("'", "'\\''")}' \\; pasteb -t #{win} \\; send-keys -t #{win} Enter]
+ end
+
def capture pane = 0
File.unlink TEMPNAME while File.exists? TEMPNAME
wait do
@@ -362,7 +366,7 @@ class TestGoFZF < TestBase
end
def test_query_unicode
- tmux.send_keys "(echo abc; echo 가나다) | #{fzf :query, '가다'}", :Enter
+ tmux.paste "(echo abc; echo 가나다) | #{fzf :query, '가다'}"
tmux.until { |lines| lines[-2].include? '1/2' }
tmux.send_keys :Enter
assert_equal ['가나다'], readonce.split($/)
@@ -1313,7 +1317,7 @@ module TestShell
def test_ctrl_t_unicode
FileUtils.mkdir_p '/tmp/fzf-test'
- tmux.send_keys 'cd /tmp/fzf-test; echo -n test1 > "fzf-unicode 테스트1"; echo -n test2 > "fzf-unicode 테스트2"', :Enter
+ tmux.paste 'cd /tmp/fzf-test; echo -n test1 > "fzf-unicode 테스트1"; echo -n test2 > "fzf-unicode 테스트2"'
tmux.prepare
tmux.send_keys 'cat ', 'C-t', pane: 0
tmux.until(1) { |lines| lines.item_count >= 1 }
@@ -1323,6 +1327,7 @@ module TestShell
tmux.until(1) { |lines| lines[-2].include? '(2)' }
tmux.send_keys :Enter, pane: 1
tmux.until { |lines| lines[-1].include?('cat') || lines[-2].include?('cat') }
+ tmux.until { |lines| lines[-1].include?('fzf-unicode') || lines[-2].include?('fzf-unicode') }
tmux.send_keys :Enter
tmux.until { |lines| lines[-1].include? 'test1test2' }
end
@@ -1530,7 +1535,7 @@ module CompletionTest
def test_file_completion_unicode
FileUtils.mkdir_p '/tmp/fzf-test'
- tmux.send_keys 'cd /tmp/fzf-test; echo -n test3 > "fzf-unicode 테스트1"; echo -n test4 > "fzf-unicode 테스트2"', :Enter
+ tmux.paste 'cd /tmp/fzf-test; echo -n test3 > "fzf-unicode 테스트1"; echo -n test4 > "fzf-unicode 테스트2"'
tmux.prepare
tmux.send_keys 'cat fzf-unicode**', :Tab, pane: 0
tmux.until(1) { |lines| lines[-2].start_with? ' 2/' }