fzf/test/fzf.vader

38 lines
1.3 KiB
Plaintext
Raw Normal View History

2014-03-25 10:55:52 +00:00
Execute (Setup):
let g:dir = fnamemodify(g:vader_file, ':p:h')
Log 'Test directory: ' . g:dir
Execute (fzf#run with dir option):
let result = fzf#run({ 'options': '--filter=vdr', 'dir': g:dir })
AssertEqual ['fzf.vader'], result
let result = sort(fzf#run({ 'options': '--filter e', 'dir': g:dir }))
2015-02-18 03:12:59 +00:00
AssertEqual ['fzf.vader', 'test_go.rb', 'test_ruby.rb'], result
2014-03-25 10:55:52 +00:00
Execute (fzf#run with Funcref command):
let g:ret = []
2015-02-18 03:12:59 +00:00
function! g:FzfTest(e)
2014-03-25 10:55:52 +00:00
call add(g:ret, a:e)
endfunction
2015-02-18 03:12:59 +00:00
let result = sort(fzf#run({ 'sink': function('g:FzfTest'), 'options': '--filter e', 'dir': g:dir }))
AssertEqual ['fzf.vader', 'test_go.rb', 'test_ruby.rb'], result
AssertEqual ['fzf.vader', 'test_go.rb', 'test_ruby.rb'], sort(g:ret)
2014-03-25 10:55:52 +00:00
Execute (fzf#run with string source):
let result = sort(fzf#run({ 'source': 'echo hi', 'options': '-f i' }))
AssertEqual ['hi'], result
Execute (fzf#run with list source):
let result = sort(fzf#run({ 'source': ['hello', 'world'], 'options': '-f e' }))
AssertEqual ['hello'], result
let result = sort(fzf#run({ 'source': ['hello', 'world'], 'options': '-f o' }))
AssertEqual ['hello', 'world'], result
Execute (fzf#run with string source):
let result = sort(fzf#run({ 'source': 'echo hi', 'options': '-f i' }))
AssertEqual ['hi'], result
Execute (Cleanup):
unlet g:dir
Restore