summaryrefslogtreecommitdiff
path: root/test/handler
diff options
context:
space:
mode:
Diffstat (limited to 'test/handler')
-rw-r--r--test/handler/test_deadnix_handler.vader27
1 files changed, 27 insertions, 0 deletions
diff --git a/test/handler/test_deadnix_handler.vader b/test/handler/test_deadnix_handler.vader
new file mode 100644
index 00000000..242af881
--- /dev/null
+++ b/test/handler/test_deadnix_handler.vader
@@ -0,0 +1,27 @@
+Execute(The deadnix handler should handle deadnix output):
+ let output = [
+ \'{"file":"./flake.nix","results":[{"column":5,"endColumn":9,"line":23,"message":"Unused lambda pattern: self"},{"column":2,"endColumn":6,"line":1,"message":"Unused lambda pattern: pkgs"}]}'
+ \]
+
+ AssertEqual
+ \ [
+ \ {
+ \ 'lnum': 23,
+ \ 'col': 5,
+ \ 'end_col': 9,
+ \ 'text': 'Unused lambda pattern: self',
+ \ 'type': 'W',
+ \ },
+ \ {
+ \ 'lnum': 1,
+ \ 'col': 2,
+ \ 'end_col': 6,
+ \ 'text': 'Unused lambda pattern: pkgs',
+ \ 'type': 'W',
+ \ },
+ \ ],
+ \ ale#handlers#deadnix#Handle(bufnr(''), output)
+
+ AssertEqual [], ale#handlers#deadnix#Handle(bufnr(''), [''])
+ AssertEqual [], ale#handlers#deadnix#Handle(bufnr(''), ['not json'])
+ AssertEqual [], ale#handlers#deadnix#Handle(bufnr(''), ['{"results":[{}]}'])