summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/handler/test_zeek_handler.vader17
-rw-r--r--test/linter/test_zeek.vader17
2 files changed, 34 insertions, 0 deletions
diff --git a/test/handler/test_zeek_handler.vader b/test/handler/test_zeek_handler.vader
new file mode 100644
index 00000000..07a80d86
--- /dev/null
+++ b/test/handler/test_zeek_handler.vader
@@ -0,0 +1,17 @@
+Before:
+ runtime ale_linters/zeek/zeek.vim
+
+After:
+ call ale#linter#Reset()
+
+Execute(The zeek handler should parse input correctly):
+ AssertEqual
+ \ [
+ \ {
+ \ 'lnum': 2,
+ \ 'text': 'unknown identifier bar, at or near "bar"'
+ \ },
+ \ ],
+ \ ale_linters#zeek#zeek#HandleErrors(bufnr(''), [
+ \ 'error in /tmp/foo.zeek, line 2: unknown identifier bar, at or near "bar"'
+ \ ])
diff --git a/test/linter/test_zeek.vader b/test/linter/test_zeek.vader
new file mode 100644
index 00000000..af58a414
--- /dev/null
+++ b/test/linter/test_zeek.vader
@@ -0,0 +1,17 @@
+Before:
+ call ale#assert#SetUpLinterTest('zeek', 'zeek')
+
+ let b:command_tail = ' --parse-only %s'
+
+After:
+ call ale#assert#TearDownLinterTest()
+
+ unlet! b:command_tail
+
+Execute(The default command should be correct):
+ AssertLinter 'zeek', ale#Escape('zeek') . b:command_tail
+
+Execute(The zeek executable should be configurable, and escaped properly):
+ let g:ale_zeek_zeek_executable = 'executable with spaces'
+
+ AssertLinter 'executable with spaces', ale#Escape('executable with spaces') . b:command_tail