ale/test/handler/test_perl_handler.vader

39 lines
1.7 KiB
Plaintext
Raw Normal View History

Before:
silent! cd /testplugin/test/handler
2017-06-22 12:51:18 +00:00
let g:dir = getcwd()
runtime ale_linters/perl/perl.vim
After:
2017-06-22 12:51:18 +00:00
silent execute 'cd ' . fnameescape(g:dir)
unlet! g:dir
call ale#linter#Reset()
Execute(The Perl linter should ignore errors from other files):
2017-06-22 12:51:18 +00:00
call ale#test#SetFilename('bar.pl')
AssertEqual
\ [
\ {'lnum': '2', 'type': 'E', 'text': 'Compilation failed in require'},
\ ],
\ ale_linters#perl#perl#Handle(bufnr(''), [
2017-06-22 12:51:18 +00:00
\ 'syntax error at ' . g:dir . '/foo.pm line 4, near "aklsdfjmy "',
\ 'Compilation failed in require at ' . g:dir . '/bar.pl line 2.',
\ 'BEGIN failed--compilation aborted at ' . g:dir . '/bar.pl line 2.',
\ ])
2017-06-22 11:37:08 +00:00
Execute(The Perl linter should complain about failing to locate modules):
AssertEqual
\ [
\ {
\ 'lnum': '23',
\ 'type': 'E',
\ 'text': 'Can''t locate JustOneDb.pm in @INC (you may need to install the JustOneDb module) (@INC contains: /home/local/sean/work/PostgreSQL/6616/../../../../lib /home/local/sean/work/PostgreSQL/6616/lib lib /etc/perl /usr/local/lib/perl/5.18.2 /usr/local/share/perl/5.18.2 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.18 /usr/share/perl/5.18 /usr/local/lib/site_perl .)',
\ },
\ ],
\ ale_linters#perl#perl#Handle(bufnr(''), [
\ 'Can''t locate JustOneDb.pm in @INC (you may need to install the JustOneDb module) (@INC contains: /home/local/sean/work/PostgreSQL/6616/../../../../lib /home/local/sean/work/PostgreSQL/6616/lib lib /etc/perl /usr/local/lib/perl/5.18.2 /usr/local/share/perl/5.18.2 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.18 /usr/share/perl/5.18 /usr/local/lib/site_perl .) at - line 23.',
\ 'BEGIN failed--compilation aborted at - line 23.',
\ ])