Skip to content

Commit

Permalink
complete: separate tests for go#complete#GetInfo
Browse files Browse the repository at this point in the history
  • Loading branch information
bhcleek committed May 26, 2019
1 parent 9d6d5cc commit c70f333
Showing 1 changed file with 13 additions and 9 deletions.
22 changes: 13 additions & 9 deletions autoload/go/complete_test.vim
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,27 @@
let s:cpo_save = &cpo
set cpo&vim

func! Test_GetInfo()
func! Test_GetInfo_gocode()
let g:go_info_mode = 'gocode'
call s:getinfo()
unlet g:go_info_mode
endfunction

func! Test_GetInfo_guru()
let g:go_info_mode = 'guru'
call s:getinfo()
unlet g:go_info_mode
endfunction

func! s:getinfo()
let l:filename = 'complete/complete.go'
let l:tmp = gotest#load_fixture(l:filename)

call cursor(8, 3)

let g:go_info_mode = 'gocode'
let expected = 'func Example(s string)'
let actual = go#complete#GetInfo()
call assert_equal(expected, actual)

let g:go_info_mode = 'guru'
call go#config#InfoMode()
let actual = go#complete#GetInfo()
call assert_equal(expected, actual)

unlet g:go_info_mode
endfunction

" restore Vi compatibility settings
Expand Down

0 comments on commit c70f333

Please sign in to comment.