summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorw0rp <devw0rp@gmail.com>2017-06-22 12:37:08 +0100
committerw0rp <devw0rp@gmail.com>2017-06-22 12:37:08 +0100
commitce2bfa88eb3dbfe1e2d0f6dd8b0781cb61c15cc1 (patch)
tree434b88cc76f8aeca09a17bd32d27eeb07e9e2f91 /test
parent40f6ee4c395214a2d9a245b80c2019dd4e24b9b1 (diff)
downloadale-ce2bfa88eb3dbfe1e2d0f6dd8b0781cb61c15cc1.zip
Fix #676 - Fix handling of Perl errors
Diffstat (limited to 'test')
-rw-r--r--test/handler/test_perl_handler.vader14
-rw-r--r--test/test_path_equality.vader6
2 files changed, 20 insertions, 0 deletions
diff --git a/test/handler/test_perl_handler.vader b/test/handler/test_perl_handler.vader
index 2961b266..b8b7b6c7 100644
--- a/test/handler/test_perl_handler.vader
+++ b/test/handler/test_perl_handler.vader
@@ -23,3 +23,17 @@ Execute(The Perl linter should ignore errors from other files):
\ 'Compilation failed in require at ' . b:path . '/bar.pl line 2.',
\ 'BEGIN failed--compilation aborted at ' . b:path . '/bar.pl line 2.',
\ ])
+
+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.',
+ \ ])
diff --git a/test/test_path_equality.vader b/test/test_path_equality.vader
index 5d92794f..7043eb5f 100644
--- a/test/test_path_equality.vader
+++ b/test/test_path_equality.vader
@@ -24,3 +24,9 @@ Execute(ale#path#IsBufferPath should match paths with redundant slashes):
silent file! foo.txt
Assert ale#path#IsBufferPath(bufnr(''), getcwd() . '////foo.txt'), 'No match for foo.txt'
+
+Execute(ale#path#IsBufferPath should accept various names for stdin):
+ Assert ale#path#IsBufferPath(bufnr(''), '-')
+ Assert ale#path#IsBufferPath(bufnr(''), 'stdin')
+ Assert ale#path#IsBufferPath(bufnr(''), '<stdin>')
+ Assert ale#path#IsBufferPath(bufnr(''), '<somethingelse>')