summaryrefslogtreecommitdiff
path: root/test/handler/test_hlint_handler.vader
diff options
context:
space:
mode:
authorw0rp <devw0rp@gmail.com>2017-07-18 13:14:02 +0100
committerw0rp <devw0rp@gmail.com>2017-07-18 13:14:02 +0100
commitaa94d0902a557bc8d65b51a868cf1e122edd2306 (patch)
tree0c632c55dba2e8464b57687a0e8713e657ba9c3d /test/handler/test_hlint_handler.vader
parent5a6ffc2804597e3b2a0ee2f6a9d5e8f52ec4c65b (diff)
downloadale-aa94d0902a557bc8d65b51a868cf1e122edd2306.zip
Fix #710 - Show hlint suggestions as info items, and include end line and column numbers
Diffstat (limited to 'test/handler/test_hlint_handler.vader')
-rw-r--r--test/handler/test_hlint_handler.vader80
1 files changed, 80 insertions, 0 deletions
diff --git a/test/handler/test_hlint_handler.vader b/test/handler/test_hlint_handler.vader
new file mode 100644
index 00000000..915e1748
--- /dev/null
+++ b/test/handler/test_hlint_handler.vader
@@ -0,0 +1,80 @@
+Before:
+ runtime! ale_linters/haskell/hlint.vim
+
+After:
+ call ale#linter#Reset()
+
+Execute(The hlint handler should parse items correctly):
+ AssertEqual
+ \ [
+ \ {
+ \ 'lnum': 1,
+ \ 'col': 4,
+ \ 'end_lnum': 3,
+ \ 'end_col': 2,
+ \ 'text': 'Error: Do something. Found: [Char] Why not: String',
+ \ 'type': 'E',
+ \ },
+ \ {
+ \ 'lnum': 2,
+ \ 'col': 4,
+ \ 'end_lnum': 7,
+ \ 'end_col': 2,
+ \ 'text': 'Warning: Do something. Found: [Char] Why not: String',
+ \ 'type': 'W',
+ \ },
+ \ {
+ \ 'lnum': 73,
+ \ 'col': 25,
+ \ 'end_lnum': 73,
+ \ 'end_col': 31,
+ \ 'text': 'Suggestion: Use String. Found: [Char] Why not: String',
+ \ 'type': 'I',
+ \ },
+ \ ],
+ \ ale_linters#haskell#hlint#Handle(bufnr(''), [json_encode([
+ \ {
+ \ 'module': 'Main',
+ \ 'decl': 'foo',
+ \ 'severity': 'Error',
+ \ 'hint': 'Do something',
+ \ 'file': '-',
+ \ 'startLine': 1,
+ \ 'startColumn': 4,
+ \ 'endLine': 3,
+ \ 'endColumn': 2,
+ \ 'from': '[Char]',
+ \ 'to': 'String',
+ \ },
+ \ {
+ \ 'module': 'Main',
+ \ 'decl': 'foo',
+ \ 'severity': 'Warning',
+ \ 'hint': 'Do something',
+ \ 'file': '-',
+ \ 'startLine': 2,
+ \ 'startColumn': 4,
+ \ 'endLine': 7,
+ \ 'endColumn': 2,
+ \ 'from': '[Char]',
+ \ 'to': 'String',
+ \ },
+ \ {
+ \ 'module': 'Main',
+ \ 'decl': 'myFocusedBorderColor',
+ \ 'severity': 'Suggestion',
+ \ 'hint': 'Use String',
+ \ 'file': '-',
+ \ 'startLine': 73,
+ \ 'startColumn': 25,
+ \ 'endLine': 73,
+ \ 'endColumn': 31,
+ \ 'from': '[Char]',
+ \ 'to': 'String',
+ \ },
+ \ ])])
+
+Execute(The hlint handler should handle empty output):
+ AssertEqual
+ \ [],
+ \ ale_linters#haskell#hlint#Handle(bufnr(''), [])