Fix the Perl tests in Docker

This commit is contained in:
w0rp 2017-06-22 13:51:18 +01:00
parent ce2bfa88eb
commit 47401a6eda

View file

@ -1,27 +1,26 @@
Before: Before:
" Switch to the test rails directory.
let b:path = getcwd()
silent! cd /testplugin/test/handler silent! cd /testplugin/test/handler
let g:dir = getcwd()
runtime ale_linters/perl/perl.vim runtime ale_linters/perl/perl.vim
After: After:
silent! 'cd ' . fnameescape(b:path) silent execute 'cd ' . fnameescape(g:dir)
unlet! b:path unlet! g:dir
call ale#linter#Reset() call ale#linter#Reset()
Execute(The Perl linter should ignore errors from other files): Execute(The Perl linter should ignore errors from other files):
silent! noautocmd file bar.pl call ale#test#SetFilename('bar.pl')
AssertEqual AssertEqual
\ [ \ [
\ {'lnum': '2', 'type': 'E', 'text': 'Compilation failed in require'}, \ {'lnum': '2', 'type': 'E', 'text': 'Compilation failed in require'},
\ ], \ ],
\ ale_linters#perl#perl#Handle(bufnr(''), [ \ ale_linters#perl#perl#Handle(bufnr(''), [
\ 'syntax error at ' . b:path . '/foo.pm line 4, near "aklsdfjmy "', \ 'syntax error at ' . g:dir . '/foo.pm line 4, near "aklsdfjmy "',
\ 'Compilation failed in require at ' . b:path . '/bar.pl line 2.', \ 'Compilation failed in require at ' . g:dir . '/bar.pl line 2.',
\ 'BEGIN failed--compilation aborted at ' . b:path . '/bar.pl line 2.', \ 'BEGIN failed--compilation aborted at ' . g:dir . '/bar.pl line 2.',
\ ]) \ ])
Execute(The Perl linter should complain about failing to locate modules): Execute(The Perl linter should complain about failing to locate modules):