test_hlint_handler.vader
1 Before: 2 runtime! ale_linters/haskell/hlint.vim 3 4 After: 5 call ale#linter#Reset() 6 7 Execute(The hlint handler should parse items correctly): 8 AssertEqual 9 \ [ 10 \ { 11 \ 'lnum': 1, 12 \ 'col': 4, 13 \ 'end_lnum': 3, 14 \ 'end_col': 2, 15 \ 'text': 'Error: Do something. Found: [Char] Why not: String', 16 \ 'type': 'E', 17 \ }, 18 \ { 19 \ 'lnum': 2, 20 \ 'col': 4, 21 \ 'end_lnum': 7, 22 \ 'end_col': 2, 23 \ 'text': 'Warning: Do something. Found: [Char] Why not: String', 24 \ 'type': 'W', 25 \ }, 26 \ { 27 \ 'lnum': 73, 28 \ 'col': 25, 29 \ 'end_lnum': 73, 30 \ 'end_col': 31, 31 \ 'text': 'Suggestion: Use String. Found: [Char] Why not: String', 32 \ 'type': 'I', 33 \ }, 34 \ ], 35 \ ale_linters#haskell#hlint#Handle(bufnr(''), [json_encode([ 36 \ { 37 \ 'module': 'Main', 38 \ 'decl': 'foo', 39 \ 'severity': 'Error', 40 \ 'hint': 'Do something', 41 \ 'file': '-', 42 \ 'startLine': 1, 43 \ 'startColumn': 4, 44 \ 'endLine': 3, 45 \ 'endColumn': 2, 46 \ 'from': '[Char]', 47 \ 'to': 'String', 48 \ }, 49 \ { 50 \ 'module': 'Main', 51 \ 'decl': 'foo', 52 \ 'severity': 'Warning', 53 \ 'hint': 'Do something', 54 \ 'file': '-', 55 \ 'startLine': 2, 56 \ 'startColumn': 4, 57 \ 'endLine': 7, 58 \ 'endColumn': 2, 59 \ 'from': '[Char]', 60 \ 'to': 'String', 61 \ }, 62 \ { 63 \ 'module': 'Main', 64 \ 'decl': 'myFocusedBorderColor', 65 \ 'severity': 'Suggestion', 66 \ 'hint': 'Use String', 67 \ 'file': '-', 68 \ 'startLine': 73, 69 \ 'startColumn': 25, 70 \ 'endLine': 73, 71 \ 'endColumn': 31, 72 \ 'from': '[Char]', 73 \ 'to': 'String', 74 \ }, 75 \ ])]) 76 77 Execute(The hlint handler should handle empty output): 78 AssertEqual 79 \ [], 80 \ ale_linters#haskell#hlint#Handle(bufnr(''), [])