m/fzf
1
0
mirror of https://github.com/junegunn/fzf.git synced 2025-11-16 15:23:48 -05:00

Make --extended default

Close #400
This commit is contained in:
Junegunn Choi
2015-11-03 22:49:32 +09:00
parent 68541e66b7
commit 81a88693c1
10 changed files with 100 additions and 77 deletions

View File

@@ -8,7 +8,7 @@ DEFAULT_TIMEOUT = 20
base = File.expand_path('../../', __FILE__)
Dir.chdir base
FZF = "#{base}/bin/fzf"
FZF = "FZF_DEFAULT_OPTS= FZF_DEFAULT_COMMAND= #{base}/bin/fzf"
class NilClass
def include? str
@@ -213,7 +213,7 @@ class TestGoFZF < TestBase
end
def test_fzf_default_command
tmux.send_keys "FZF_DEFAULT_COMMAND='echo hello' #{fzf}", :Enter
tmux.send_keys fzf.sub('FZF_DEFAULT_COMMAND=', "FZF_DEFAULT_COMMAND='echo hello'"), :Enter
tmux.until { |lines| lines.last =~ /^>/ }
tmux.send_keys :Enter
@@ -904,6 +904,17 @@ class TestGoFZF < TestBase
end
end
def test_default_extended
assert_equal '100', `seq 100 | #{FZF} -f "1 00$"`.chomp
assert_equal '', `seq 100 | #{FZF} -f "1 00$" +x`.chomp
end
def test_exact
assert_equal 4, `seq 123 | #{FZF} -f 13`.lines.length
assert_equal 2, `seq 123 | #{FZF} -f 13 -e`.lines.length
assert_equal 4, `seq 123 | #{FZF} -f 13 +e`.lines.length
end
private
def writelines path, lines
File.unlink path while File.exists? path