]> git.madduck.net Git - etc/vim.git/blob - .vim/bundle/ale/test/handler/test_common_handlers.vader

madduck's git repository

Every one of the projects in this repository is available at the canonical URL git://git.madduck.net/madduck/pub/<projectpath> — see each project's metadata for the exact URL.

All patches and comments are welcome. Please squash your changes to logical commits before using git-format-patch and git-send-email to patches@git.madduck.net. If you'd read over the Git project's submission guidelines and adhered to them, I'd be especially grateful.

SSH access, as well as push access can be individually arranged.

If you use my repositories frequently, consider adding the following snippet to ~/.gitconfig and using the third clone URL listed for each project:

[url "git://git.madduck.net/madduck/"]
  insteadOf = madduck:

Merge commit '76265755a1add77121c8f9dabb3e9bb70fe9a972' as '.vim/bundle/ale'
[etc/vim.git] / .vim / bundle / ale / test / handler / test_common_handlers.vader
1 Execute(HandleCSSLintFormat should handle CSS errors):
2   AssertEqual
3   \ [
4   \   {
5   \     'lnum': 2,
6   \     'col': 1,
7   \     'type': 'E',
8   \     'text': 'Expected RBRACE at line 2, col 1.',
9   \     'code': 'errors',
10   \   },
11   \   {
12   \    'lnum': 2,
13   \    'col': 5,
14   \    'type': 'W',
15   \    'text': 'Expected ... but found ''wat''.',
16   \    'code': 'known-properties',
17   \   },
18   \ ],
19   \ ale#handlers#css#HandleCSSLintFormat(42, [
20   \   'something.css: line 2, col 1, Error - Expected RBRACE at line 2, col 1. (errors)',
21   \   'something.css: line 2, col 5, Warning - Expected ... but found ''wat''. (known-properties)',
22   \ ])
23
24 Execute(HandleCSSLintFormat should handle CSS errors without groups):
25   AssertEqual
26   \ [
27   \   {
28   \    'lnum': 7,
29   \    'col': 3,
30   \    'type': 'W',
31   \    'text': 'Unknown property ''fill''.',
32   \   },
33   \   {
34   \    'lnum': 8,
35   \    'col': 3,
36   \    'type': 'W',
37   \    'text': 'Unknown property ''fill-opacity''.',
38   \   },
39   \ ],
40   \ ale#handlers#css#HandleCSSLintFormat(42, [
41   \   'something.css: line 7, col 3, Warning - Unknown property ''fill''.',
42   \   'something.css: line 8, col 3, Warning - Unknown property ''fill-opacity''.',
43   \ ])
44
45 Execute (HandleGCCFormat should handle the correct lines of output):
46   AssertEqual
47   \ [
48   \   {
49   \     'lnum': 8,
50   \     'col': 5,
51   \     'type': 'W',
52   \     'text': 'conversion lacks type at end of format [-Wformat=]',
53   \   },
54   \   {
55   \     'lnum': 10,
56   \     'col': 27,
57   \     'type': 'E',
58   \     'text': 'invalid operands to binary - (have ''int'' and ''char *'')',
59   \   },
60   \ ],
61   \ ale#handlers#gcc#HandleGCCFormat(42, [
62   \   '<stdin>:8:5: warning: conversion lacks type at end of format [-Wformat=]',
63   \   '<stdin>:10:27: error: invalid operands to binary - (have ‘int’ and ‘char *’)',
64   \ ])
65
66 Execute (HandleGCCFormat should replace Unicode quotes):
67   AssertEqual
68   \ [
69   \   {
70   \     'lnum': 8,
71   \     'col': 5,
72   \     'type': 'W',
73   \     'text': "'''' \"\"",
74   \   },
75   \ ],
76   \ ale#handlers#gcc#HandleGCCFormat(42, ['<stdin>:8:5: warning: `´‘’ “”'])
77
78 Execute (HandleUnixFormatAsError should handle some example lines of output):
79   AssertEqual
80   \ [
81   \   {
82   \     'lnum': 27,
83   \     'col': 0,
84   \     'type': 'E',
85   \     'text': 'missing argument for Printf("%s"): format reads arg 2, have only 1 args',
86   \   },
87   \   {
88   \     'lnum': 53,
89   \     'col': 10,
90   \     'type': 'E',
91   \     'text': 'if block ends with a return statement, so drop this else and outdent its block (move short variable declaration to its own line if necessary)',
92   \   },
93   \   {
94   \     'lnum': 1,
95   \     'col': 1,
96   \     'type': 'E',
97   \     'text': '".b" is not a valid class name.  Class names must begin with "-", "_" or a letter and can only contain "_", "-", a-z and 0-9.',
98   \   },
99   \ ],
100   \ ale#handlers#unix#HandleAsError(42, [
101   \   'file.go:27: missing argument for Printf("%s"): format reads arg 2, have only 1 args',
102   \   'file.go:53:10: if block ends with a return statement, so drop this else and outdent its block (move short variable declaration to its own line if necessary)',
103   \   'test.pug:1:1 ".b" is not a valid class name.  Class names must begin with "-", "_" or a letter and can only contain "_", "-", a-z and 0-9.',
104   \ ])
105
106 Execute (HandleUnixFormatAsError should handle lines with no space after the colon):
107   AssertEqual
108   \ [
109   \   {
110   \     'lnum': 27,
111   \     'col': 0,
112   \     'type': 'E',
113   \     'text': 'foo',
114   \   },
115   \   {
116   \     'lnum': 53,
117   \     'col': 10,
118   \     'type': 'E',
119   \     'text': 'bar',
120   \   },
121   \ ],
122   \ ale#handlers#unix#HandleAsError(42, [
123   \   'some_file.xyz:27:foo',
124   \   'some_file.xyz:53:10:bar',
125   \ ])
126
127 Execute (HandleUnixFormatAsError should handle names with spaces):
128   AssertEqual
129   \ [
130   \   {
131   \     'lnum': 13,
132   \     'col': 90,
133   \     'type': 'E',
134   \     'text': 'leonard.exclamation.30ppm More than 30 ppm of exclamations. Keep them under control.',
135   \   },
136   \ ],
137   \ ale#handlers#unix#HandleAsError(42, [
138   \   '/Users/rrj/Notes/Astro/Taurus December SM.txt:13:90: leonard.exclamation.30ppm More than 30 ppm of exclamations. Keep them under control.',
139   \ ])
140
141 Execute (HandleUnixFormatAsWarning should handle some example lines of output):
142   AssertEqual
143   \ [
144   \   {
145   \     'lnum': 27,
146   \     'col': 0,
147   \     'type': 'W',
148   \     'text': 'missing argument for Printf("%s"): format reads arg 2, have only 1 args',
149   \   },
150   \   {
151   \     'lnum': 53,
152   \     'col': 10,
153   \     'type': 'W',
154   \     'text': 'if block ends with a return statement, so drop this else and outdent its block (move short variable declaration to its own line if necessary)',
155   \   },
156   \ ],
157   \ ale#handlers#unix#HandleAsWarning(42, [
158   \   'file.go:27: missing argument for Printf("%s"): format reads arg 2, have only 1 args',
159   \   'file.go:53:10: if block ends with a return statement, so drop this else and outdent its block (move short variable declaration to its own line if necessary)',
160   \ ])
161
162 Execute (Unix format functions should handle Windows paths):
163   AssertEqual
164   \ [
165   \   {
166   \     'lnum': 27,
167   \     'col': 0,
168   \     'type': 'E',
169   \     'text': 'foo',
170   \   },
171   \   {
172   \     'lnum': 53,
173   \     'col': 10,
174   \     'type': 'E',
175   \     'text': 'foo',
176   \   },
177   \ ],
178   \ ale#handlers#unix#HandleAsError(42, [
179   \   'C:\Users\w0rp\AppData\Local\Temp\Xyz123.go:27: foo',
180   \   'C:\Users\w0rp\AppData\Local\Temp\Xyz123.go:53:10: foo',
181   \ ])