summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorJunegunn Choi <junegunn.c@gmail.com>2015-09-15 19:04:53 +0900
committerJunegunn Choi <junegunn.c@gmail.com>2015-09-15 19:04:53 +0900
commit2022a3ad96f027e056e4fcce11fee0976db657d1 (patch)
treeea0d8c2f34c38577b994971c7a186760223210c9 /test
parent65d9d416b4300e85304fd158d9df2f6272590849 (diff)
Replace --header-file with --header (#346)
and allow using --header and --header-lines at the same time. Close #346.
Diffstat (limited to 'test')
-rw-r--r--test/test_go.rb28
1 files changed, 24 insertions, 4 deletions
diff --git a/test/test_go.rb b/test/test_go.rb
index 5b352647..e76b5200 100644
--- a/test/test_go.rb
+++ b/test/test_go.rb
@@ -737,8 +737,8 @@ class TestGoFZF < TestBase
assert_equal '6', readonce.chomp
end
- def test_header_file
- tmux.send_keys "seq 100 | #{fzf "--header-file <(head -5 #{__FILE__})"}", :Enter
+ def test_header
+ tmux.send_keys "seq 100 | #{fzf "--header \\\"\\$(head -5 #{__FILE__})\\\""}", :Enter
header = File.readlines(__FILE__).take(5).map(&:strip)
tmux.until do |lines|
lines[-2].include?('100/100') &&
@@ -746,8 +746,8 @@ class TestGoFZF < TestBase
end
end
- def test_header_file_reverse
- tmux.send_keys "seq 100 | #{fzf "--header-file=<(head -5 #{__FILE__}) --reverse"}", :Enter
+ def test_header_reverse
+ tmux.send_keys "seq 100 | #{fzf "--header=\\\"\\$(head -5 #{__FILE__})\\\" --reverse"}", :Enter
header = File.readlines(__FILE__).take(5).map(&:strip)
tmux.until do |lines|
lines[1].include?('100/100') &&
@@ -755,6 +755,26 @@ class TestGoFZF < TestBase
end
end
+ def test_header_and_header_lines
+ tmux.send_keys "seq 100 | #{fzf "--header-lines 10 --header \\\"\\$(head -5 #{__FILE__})\\\""}", :Enter
+ header = File.readlines(__FILE__).take(5).map(&:strip)
+ tmux.until do |lines|
+ lines[-2].include?('90/90') &&
+ lines[-7...-2].map(&:strip) == header &&
+ lines[-17...-7].map(&:strip) == (1..10).map(&:to_s).reverse
+ end
+ end
+
+ def test_header_and_header_lines_reverse
+ tmux.send_keys "seq 100 | #{fzf "--reverse --header-lines 10 --header \\\"\\$(head -5 #{__FILE__})\\\""}", :Enter
+ header = File.readlines(__FILE__).take(5).map(&:strip)
+ tmux.until do |lines|
+ lines[1].include?('90/90') &&
+ lines[2...7].map(&:strip) == header &&
+ lines[7...17].map(&:strip) == (1..10).map(&:to_s)
+ end
+ end
+
def test_canel
tmux.send_keys "seq 10 | #{fzf "--bind 2:cancel"}", :Enter
tmux.until { |lines| lines[-2].include?('10/10') }