summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/command_callback/test_gotype_command_callback.vader19
-rw-r--r--test/go_files/testfile2.go0
2 files changed, 19 insertions, 0 deletions
diff --git a/test/command_callback/test_gotype_command_callback.vader b/test/command_callback/test_gotype_command_callback.vader
new file mode 100644
index 00000000..f95e8423
--- /dev/null
+++ b/test/command_callback/test_gotype_command_callback.vader
@@ -0,0 +1,19 @@
+Before:
+ runtime ale_linters/go/gotype.vim
+ call ale#test#SetFilename('../go_files/testfile2.go')
+
+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 gotype callback should ignore test files):
+ call ale#test#SetFilename('bla_test.go')
+ AssertEqual
+ \ 0,
+ \ ale_linters#go#gotype#GetCommand(bufnr(''))
diff --git a/test/go_files/testfile2.go b/test/go_files/testfile2.go
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/test/go_files/testfile2.go