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.
2 call ale#test#SetDirectory('/testplugin/test/handler')
4 runtime ale_linters/perl6/perl6.vim
7 call ale#test#RestoreDirectory()
8 call ale#linter#Reset()
10 Execute(The Perl6 linter should handle empty output):
11 call ale#test#SetFilename('bar.pl6')
13 AssertEqual [], ale_linters#perl6#perl6#Handle(bufnr(''), [])
15 Execute(The Perl6 linter should complain about undeclared variables):
16 call ale#test#SetFilename('bar.pl6')
22 \ 'text': 'Variable ''$tes'' is not declared. Did you mean any of these? $res $test ',
26 \ 'code': 'X::Undeclared',
29 \ ale_linters#perl6#perl6#Handle(bufnr(''), [
33 \ "is-compile-time" : 1,
38 \ "filename" : "bar.pl6",
39 \ "what" : "Variable",
40 \ "pre" : "my $test = 0; say ",
47 \ "message" : "Variable ''$tes'' is not declared. Did you mean any of these?\n $res\n $test\n"
52 Execute(The Perl6 linter should complain about Comp::AdHoc errors):
53 call ale#test#SetFilename('bar.pl6')
60 \ 'text': 'is repr(...) trait needs a parameter',
63 \ 'code': 'X::Comp::AdHoc',
66 \ ale_linters#perl6#perl6#Handle(bufnr(''), [
68 \ "X::Comp::AdHoc" : {
69 \ "pre" : "class test is repr",
70 \ "message" : "is repr(...) trait needs a parameter",
73 \ "is-compile-time" : true,
76 \ "payload" : "is repr(...) trait needs a parameter",
77 \ "filename" : "bar.pl6",
84 Execute(The Perl6 linter should be able to extract a line number from an error message):
85 call ale#test#SetFilename('bar.pl6')
91 \ 'text': 'Could not find Module::Does::not::exist at line 3 in: /usr/share/perl6/site /usr/share/perl6/vendor /usr/share/perl6 CompUnit::Repository::AbsolutePath<94023691448416> CompUnit::Repository::NQP<94023670532736> CompUnit::Repository::Perl5<94023670532776>',
95 \ 'code': 'X::CompUnit::UnsatisfiedDependency',
98 \ ale_linters#perl6#perl6#Handle(bufnr(''), [
100 \ "X::CompUnit::UnsatisfiedDependency" : {
101 \ "message" : "Could not find Module::Does::not::exist at line 3 in:\n /usr/share/perl6/site\n /usr/share/perl6/vendor\n /usr/share/perl6\n CompUnit::Repository::AbsolutePath<94023691448416>\n CompUnit::Repository::NQP<94023670532736>\n CompUnit::Repository::Perl5<94023670532776>",
102 \ "specification" : "Module::Does::not::exist"
107 Execute(The Perl6 linter should be able to differentiate between warnings and errors):
108 call ale#test#SetFilename('bar.pl6')
115 \ 'code': 'X::Syntax::Regex::Unterminated',
118 \ 'text': 'Regex not terminated.',
123 \ 'code': 'X::Comp::AdHoc',
126 \ 'text': 'Space is not significant here; please use quotes or :s (:sigspace) modifier (or, to suppress this warning, omit the space, or otherwise change the spacing)',
129 \ ale_linters#perl6#perl6#Handle(bufnr(''), [
131 \ "X::Comp::Group" : {
132 \ "message" : "Regex not terminated.\nUnable to parse regex; couldn''t find final ''/''\nSpace is not significant here; please use quotes or :s (:sigspace) modifier (or, to suppress this warning, omit the space, or otherwise change the spacing)",
133 \ "panic" : "Unable to parse regex; couldn''t find final ''/''",
136 \ "X::Syntax::Regex::Unterminated" : {
141 \ "is-compile-time" : 1,
144 \ "message" : "Regex not terminated.",
146 \ "filename" : "bar.pl6",
154 \ "X::Comp::AdHoc" : {
155 \ "filename" : "bar.pl6",
159 \ "highexpect" : [ ],
160 \ "payload" : "Space is not significant here; please use quotes or :s (:sigspace) modifier (or, to suppress this warning, omit the space, or otherwise change the spacing)",
162 \ "message" : "Space is not significant here; please use quotes or :s (:sigspace) modifier (or, to suppress this warning, omit the space, or otherwise change the spacing)",
164 \ "is-compile-time" : true,
173 Execute(The Perl6 linter should gracefully handle non-JSON messages):
174 call ale#test#SetFilename('bar.pl6')
180 \ 'text': 'Received output in the default Perl6 error format. See :ALEDetail for details',
183 \ 'Potential difficulties:',
184 \ ' Redeclaration of symbol ''$_''',
185 \ ' at /home/travis/perl6-error-fail/insanity-test.pl6:1',
186 \ ' ------> sub foo($_) {.say}; my $_<HERE> = 1; .&foo;',
187 \ ' Space is not significant here; please use quotes or :s (:sigspace) modifier (or, to suppress this warning, omit the space, or otherwise change the spacing)',
188 \ ' at /home/travis/perl6-error-fail/insanity-test.pl6:4',
189 \ ' ------> /win<HERE> 3/',
190 \ 'Syntax OK',], "\n")
193 \ ale_linters#perl6#perl6#Handle(bufnr(''), [
194 \ 'Potential difficulties:',
195 \ ' Redeclaration of symbol ''$_''',
196 \ ' at /home/travis/perl6-error-fail/insanity-test.pl6:1',
197 \ ' ------> sub foo($_) {.say}; my $_<HERE> = 1; .&foo;',
198 \ ' Space is not significant here; please use quotes or :s (:sigspace) modifier (or, to suppress this warning, omit the space, or otherwise change the spacing)',
199 \ ' at /home/travis/perl6-error-fail/insanity-test.pl6:4',
200 \ ' ------> /win<HERE> 3/',
204 Execute(The Perl6 linter should gracefully handle messages without a line number):
205 call ale#test#SetFilename('bar.pl6')
212 \ 'text': 'Cannot find method ''has_compile_time_value'' on object of type NQPMu',
215 \ 'code': 'X::AdHoc',
218 \ ale_linters#perl6#perl6#Handle(bufnr(''), [
221 \ '"message" : "Cannot find method ''has_compile_time_value'' on object of type NQPMu",',
222 \ '"payload" : "Cannot find method ''has_compile_time_value'' on object of type NQPMu"',
227 Execute(The Perl6 linter should not include errors from a known separate file):
228 call ale#test#SetFilename('bar.pl6')
232 \ ale_linters#perl6#perl6#Handle(bufnr(''), [
234 \ "X::Undeclared" : {
235 \ "highexpect" : [ ],
236 \ "is-compile-time" : 1,
241 \ "filename" : "foo.pl6",
242 \ "what" : "Variable",
243 \ "pre" : "my $test = 0; say ",
250 \ "message" : "Variable ''$tes'' is not declared. Did you mean any of these?\n $res\n $test\n"
255 Execute(The Perl6 linter should not ignore errors without a filename):
256 call ale#test#SetFilename('bar.pl6')
263 \ 'text': 'Cannot find method ''has_compile_time_value'' on object of type NQPMu',
266 \ 'code': 'X::AdHoc',
269 \ ale_linters#perl6#perl6#Handle(bufnr(''), [
273 \ '"message" : "Cannot find method ''has_compile_time_value'' on object of type NQPMu",',
274 \ '"payload" : "Cannot find method ''has_compile_time_value'' on object of type NQPMu"',