/ test / handler / test_luac_handler.vader
test_luac_handler.vader
 1  Before:
 2    Save g:ale_warn_about_trailing_whitespace
 3  
 4    let g:ale_warn_about_trailing_whitespace = 1
 5  
 6    runtime ale_linters/lua/luac.vim
 7  
 8  After:
 9    Restore
10    call ale#linter#Reset()
11  
12  Execute(The luac handler should parse lines correctly):
13    AssertEqual
14    \ [
15    \   {
16    \     'lnum': 1,
17    \     'text': 'line contains trailing whitespace',
18    \     'type': 'E',
19    \   },
20    \   {
21    \     'lnum': 3,
22    \     'text': 'unexpected symbol near ''-''',
23    \     'type': 'E',
24    \   },
25    \   {
26    \     'lnum': 5,
27    \     'text': '''='' expected near '')''',
28    \     'type': 'E',
29    \   },
30    \ ],
31    \ ale_linters#lua#luac#Handle(347, [
32    \   'luac /file/path/here.lua:1: line contains trailing whitespace',
33    \   'luac /file/path/here.lua:3: unexpected symbol near ''-''',
34    \   'luac /file/path/here.lua:5: ''='' expected near '')''',
35    \ ])