/ test / handler / test_thrift_handler.vader
test_thrift_handler.vader
 1  Before:
 2    runtime ale_linters/thrift/thrift.vim
 3  
 4  After:
 5    call ale#linter#Reset()
 6  
 7  Execute(The thrift handler should handle basic warnings and errors):
 8    AssertEqual
 9    \ [
10    \   {
11    \     'lnum': 17,
12    \     'col': 0,
13    \     'type': 'W',
14    \     'text': 'The "byte" type is a compatibility alias for "i8". Use i8" to emphasize the signedness of this type.',
15    \   },
16    \   {
17    \     'lnum': 20,
18    \     'col': 0,
19    \     'type': 'W',
20    \     'text': 'Could not find include file include.thrift',
21    \   },
22    \   {
23    \     'lnum': 83,
24    \     'col': 0,
25    \     'type': 'E',
26    \     'text': 'Enum FOO is already defined!',
27    \   },
28    \ ],
29    \ ale_linters#thrift#thrift#Handle(1, [
30    \   '[WARNING:/path/filename.thrift:17] The "byte" type is a compatibility alias for "i8". Use i8" to emphasize the signedness of this type.',
31    \   '[WARNING:/path/filename.thrift:20] Could not find include file include.thrift',
32    \   '[FAILURE:/path/filename.thrift:83] Enum FOO is already defined!',
33    \ ])
34  
35  Execute(The thrift handler should handle multiline errors):
36    AssertEqual
37    \ [
38    \   {
39    \     'lnum': 75,
40    \     'col': 0,
41    \     'type': 'E',
42    \     'text': 'This integer is too big: "11111111114213213453243"',
43    \   },
44    \   {
45    \     'lnum': 76,
46    \     'col': 0,
47    \     'type': 'E',
48    \     'text': 'Implicit field keys are deprecated and not allowed with -strict',
49    \   },
50    \   {
51    \     'lnum': 77,
52    \     'col': 0,
53    \     'type': 'E',
54    \     'text': "Unknown error (last token was ';')",
55    \   },
56    \ ],
57    \ ale_linters#thrift#thrift#Handle(1, [
58    \   "[ERROR:/path/filename.thrift:75] (last token was '11111111114213213453243')",
59    \   'This integer is too big: "11111111114213213453243"',
60    \   "[ERROR:/path/filename.thrift:76] (last token was ';')",
61    \   'Implicit field keys are deprecated and not allowed with -strict',
62    \   "[ERROR:/path/filename.thrift:77] (last token was ';')",
63    \ ])