/ test / handler / test_checkstyle_handler.vader
test_checkstyle_handler.vader
 1  Before:
 2    runtime ale_linters/java/checkstyle.vim
 3  
 4  After:
 5    call ale#linter#Reset()
 6  
 7  Execute(The checkstyle handler should parse lines correctly):
 8    AssertEqual
 9    \ [
10    \   {
11    \     'lnum': 101,
12    \     'col': 0,
13    \     'text': '''method def rcurly'' has incorrect indentation level 4, expected level should be 2.',
14    \     'code': 'Indentation',
15    \     'type': 'W',
16    \     'sub_type': 'style',
17    \   },
18    \   {
19    \     'lnum': 63,
20    \     'col': 3,
21    \     'text': 'Missing a Javadoc comment.',
22    \     'code': 'JavadocMethod',
23    \     'type': 'W',
24    \     'sub_type': 'style',
25    \   },
26    \   {
27    \     'lnum': 11,
28    \     'col': 7,
29    \     'text': 'WhitespaceAround: ''if'' is not followed by whitespace.',
30    \     'code': 'WhitespaceAround',
31    \     'type': 'W',
32    \     'sub_type': 'style',
33    \   },
34    \ ],
35    \ ale_linters#java#checkstyle#Handle(666, [
36    \   '[WARN] whatever:101: ''method def rcurly'' has incorrect indentation level 4, expected level should be 2. [Indentation]',
37    \   '[WARN] whatever:63:3: Missing a Javadoc comment. [JavadocMethod]',
38    \   '[WARN] whatever:11:7: WhitespaceAround: ''if'' is not followed by whitespace. [WhitespaceAround]',
39    \ ])
40  
41  Execute(The checkstyle handler should parse lines from older checkstyle versions correctly):
42    AssertEqual
43    \ [
44    \   {
45    \     'lnum': 289,
46    \     'text': '''method def modifier'' have incorrect indentation level 4, expected level should be 2.',
47    \     'type': 'W',
48    \     'sub_type': 'style',
49    \   },
50    \ ],
51    \ ale_linters#java#checkstyle#Handle(666, [
52    \   '/home/languitar/src/rsb-java/rsb-java/src/main/java/rsb/Listener.java:289: warning: ''method def modifier'' have incorrect indentation level 4, expected level should be 2.',
53    \ ])