Fix #1392 - Only check files on disk for gotype

This commit is contained in:
w0rp
2018-03-18 17:16:13 +00:00
parent bdd8d2399f
commit c112ee9dff
4 changed files with 14 additions and 24 deletions

View File

@@ -5,15 +5,9 @@ Before:
After:
call ale#linter#Reset()
Execute(The gotype callback should include other files from the directory but exclude the file itself):
let dir = expand('#' . bufnr('') . ':p:h')
AssertEqual
\ "gotype %t ". ale#Escape(ale#path#Simplify(dir . "/testfile.go")),
\ ale_linters#go#gotype#GetCommand(bufnr(''))
Execute(The default gotype command should be correct):
AssertEqual 'gotype %s', ale_linters#go#gotype#GetCommand(bufnr(''))
Execute(The gotype callback should ignore test files):
call ale#test#SetFilename('bla_test.go')
AssertEqual
\ 0,
\ ale_linters#go#gotype#GetCommand(bufnr(''))
AssertEqual 0, ale_linters#go#gotype#GetCommand(bufnr(''))