File: test_thrift_handler.vader

package info (click to toggle)
vim-ale 4.0.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 8,764 kB
  • sloc: sh: 499; python: 311; perl: 31; makefile: 4; xml: 4; javascript: 1
file content (63 lines) | stat: -rw-r--r-- 1,907 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
Before:
  runtime ale_linters/thrift/thrift.vim

After:
  call ale#linter#Reset()

Execute(The thrift handler should handle basic warnings and errors):
  AssertEqual
  \ [
  \   {
  \     'lnum': 17,
  \     'col': 0,
  \     'type': 'W',
  \     'text': 'The "byte" type is a compatibility alias for "i8". Use i8" to emphasize the signedness of this type.',
  \   },
  \   {
  \     'lnum': 20,
  \     'col': 0,
  \     'type': 'W',
  \     'text': 'Could not find include file include.thrift',
  \   },
  \   {
  \     'lnum': 83,
  \     'col': 0,
  \     'type': 'E',
  \     'text': 'Enum FOO is already defined!',
  \   },
  \ ],
  \ ale_linters#thrift#thrift#Handle(1, [
  \   '[WARNING:/path/filename.thrift:17] The "byte" type is a compatibility alias for "i8". Use i8" to emphasize the signedness of this type.',
  \   '[WARNING:/path/filename.thrift:20] Could not find include file include.thrift',
  \   '[FAILURE:/path/filename.thrift:83] Enum FOO is already defined!',
  \ ])

Execute(The thrift handler should handle multiline errors):
  AssertEqual
  \ [
  \   {
  \     'lnum': 75,
  \     'col': 0,
  \     'type': 'E',
  \     'text': 'This integer is too big: "11111111114213213453243"',
  \   },
  \   {
  \     'lnum': 76,
  \     'col': 0,
  \     'type': 'E',
  \     'text': 'Implicit field keys are deprecated and not allowed with -strict',
  \   },
  \   {
  \     'lnum': 77,
  \     'col': 0,
  \     'type': 'E',
  \     'text': "Unknown error (last token was ';')",
  \   },
  \ ],
  \ ale_linters#thrift#thrift#Handle(1, [
  \   "[ERROR:/path/filename.thrift:75] (last token was '11111111114213213453243')",
  \   'This integer is too big: "11111111114213213453243"',
  \   "[ERROR:/path/filename.thrift:76] (last token was ';')",
  \   'Implicit field keys are deprecated and not allowed with -strict',
  \   "[ERROR:/path/filename.thrift:77] (last token was ';')",
  \ ])