Skip to content

Commit

Permalink
Merge pull request #1 from PsychoLlama/fix/ci-build
Browse files Browse the repository at this point in the history
Fix CI build
  • Loading branch information
PsychoLlama authored Jun 24, 2018
2 parents b5e8100 + d01b982 commit 4b80366
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 4 deletions.
3 changes: 3 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
language: vim

before_script:
- sudo add-apt-repository ppa:jonathonf/vim -y
- sudo apt-get update
- sudo apt-get install vim -y
- git clone https://github.com/junegunn/vader.vim.git

script: ./ci.sh
1 change: 1 addition & 0 deletions autoload/zcd.vim
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ func! zcd#Completion(args, command, cursor) abort
endif

let l:matches = zcd#FindMatches(l:search)
let l:matches = type(l:matches) == v:t_list ? l:matches : []
call map(l:matches, 'v:val.directory')

return l:matches
Expand Down
3 changes: 3 additions & 0 deletions tests/autoload/zcd.vim
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
func! zcd#FindMatches(search)
return [{ 'directory': a:search }, { 'directory': '/dir/second' }]
endfunc
4 changes: 1 addition & 3 deletions tests/completion.vader
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
Include: setup.vader

Before (stub findmatches):
func! zcd#FindMatches(search)
return [{ 'directory': a:search }, { 'directory': '/dir/second' }]
endfunc
source ./tests/autoload/zcd.vim

Execute (returns a completion list):
let actual = zcd#Completion('z', 'Z z', 2)
Expand Down
5 changes: 4 additions & 1 deletion tests/setup.vader
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,10 @@ Before (hook into script functions):

" Get the zcd.vim script ID.
for l:line in split(l:scriptnames, "\n")
if l:line =~# '\Vautoload/zcd.vim' && l:line !~# 'plugged'
let l:is_autoload = l:line =~# '\Vautoload/zcd.vim'
let l:not_plugin = l:line !~# 'plugged'
let l:not_tests = l:line !~# 'tests'
if l:is_autoload && l:not_plugin && l:not_tests
let l:SID = str2nr(matchstr(l:line, '\v^\s*\d+'))
let l:zcd_file = matchstr(l:line, '\v(\~|/).*')
return { 'SID': l:SID, 'file': expand(l:zcd_file) }
Expand Down

0 comments on commit 4b80366

Please sign in to comment.