diff options
author | Junegunn Choi <junegunn.c@gmail.com> | 2015-11-03 22:49:32 +0900 |
---|---|---|
committer | Junegunn Choi <junegunn.c@gmail.com> | 2015-11-03 22:49:32 +0900 |
commit | 81a88693c12507bcc460bd1150af0f48f917670c (patch) | |
tree | c4fc4449ad6f82dc834c211ec8e5a855528701c9 /test | |
parent | 68541e66b7b4735fc720d5298ffb3d99b115025b (diff) |
Make --extended default
Close #400
Diffstat (limited to 'test')
-rw-r--r-- | test/test_go.rb | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/test/test_go.rb b/test/test_go.rb index 77414ecd..50d401c3 100644 --- a/test/test_go.rb +++ b/test/test_go.rb @@ -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 |