mirror of
https://github.com/Llewellynvdm/fzf.git
synced 2024-11-10 15:50:56 +00:00
Add test case for --sync option
This commit is contained in:
parent
f5b034095a
commit
5667667d1f
@ -112,6 +112,10 @@ class TestGoFZF < MiniTest::Unit::TestCase
|
|||||||
end
|
end
|
||||||
|
|
||||||
def fzf(*opts)
|
def fzf(*opts)
|
||||||
|
fzf!(*opts) + " > #{TEMPNAME} && echo #{FIN}"
|
||||||
|
end
|
||||||
|
|
||||||
|
def fzf!(*opts)
|
||||||
opts = opts.map { |o|
|
opts = opts.map { |o|
|
||||||
case o
|
case o
|
||||||
when Symbol
|
when Symbol
|
||||||
@ -123,7 +127,7 @@ class TestGoFZF < MiniTest::Unit::TestCase
|
|||||||
nil
|
nil
|
||||||
end
|
end
|
||||||
}.compact
|
}.compact
|
||||||
"fzf #{opts.join ' '} > #{TEMPNAME} && echo #{FIN}"
|
"fzf #{opts.join ' '}"
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_vanilla
|
def test_vanilla
|
||||||
@ -307,5 +311,16 @@ class TestGoFZF < MiniTest::Unit::TestCase
|
|||||||
tmux.until { |lines| lines[-1].include?(FIN) }
|
tmux.until { |lines| lines[-1].include?(FIN) }
|
||||||
assert_equal ['가나다'], readonce.split($/)
|
assert_equal ['가나다'], readonce.split($/)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def test_sync
|
||||||
|
tmux.send_keys "seq 1 100 | #{fzf! :multi} | awk '{print \\$1 \\$1}' | #{fzf :sync}", :Enter
|
||||||
|
tmux.until { |lines| lines[-1] == '>' }
|
||||||
|
tmux.send_keys 9
|
||||||
|
tmux.until { |lines| lines[-2] == ' 19/100' }
|
||||||
|
tmux.send_keys :BTab, :BTab, :BTab, :Enter
|
||||||
|
tmux.until { |lines| lines[-1] == '>' }
|
||||||
|
tmux.send_keys 'C-K', :Enter
|
||||||
|
assert_equal ['1919'], readonce.split($/)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user