summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorw0rp <devw0rp@gmail.com>2017-04-03 22:51:39 +0100
committerw0rp <devw0rp@gmail.com>2017-04-03 22:51:39 +0100
commit4fc8452838253a59fabc58ba48ea7a6425261edb (patch)
tree80a11f6cfd507aa5a43afbbd657e3a8b76bbce14 /test
parent85d86620f7459fd7caf14e4b8be2880006b36881 (diff)
downloadale-4fc8452838253a59fabc58ba48ea7a6425261edb.zip
#447 Support zsh in the shell linter
Diffstat (limited to 'test')
-rw-r--r--test/handler/test_shell_handler.vader53
1 files changed, 53 insertions, 0 deletions
diff --git a/test/handler/test_shell_handler.vader b/test/handler/test_shell_handler.vader
new file mode 100644
index 00000000..12506821
--- /dev/null
+++ b/test/handler/test_shell_handler.vader
@@ -0,0 +1,53 @@
+After:
+ call ale#linter#Reset()
+
+Execute(The shell handler should parse lines correctly):
+ runtime ale_linters/sh/shell.vim
+
+ AssertEqual
+ \ [
+ \ {
+ \ 'bufnr': 347,
+ \ 'lnum': 13,
+ \ 'text': 'syntax error near unexpected token d',
+ \ 'type': 'E',
+ \ },
+ \ {
+ \ 'bufnr': 347,
+ \ 'lnum': 7,
+ \ 'text': 'line 42: line 36:',
+ \ 'type': 'E',
+ \ },
+ \ {
+ \ 'bufnr': 347,
+ \ 'lnum': 11,
+ \ 'text': 'Syntax error: "(" unexpected',
+ \ 'type': 'E',
+ \ },
+ \ {
+ \ 'bufnr': 347,
+ \ 'lnum': 95,
+ \ 'text': 'parse error near `out=$(( $1 / 1024. )...',
+ \ 'type': 'E',
+ \ },
+ \ {
+ \ 'bufnr': 347,
+ \ 'lnum': 22,
+ \ 'text': ':11: :33: :44:',
+ \ 'type': 'E',
+ \ },
+ \ {
+ \ 'bufnr': 347,
+ \ 'lnum': 9,
+ \ 'text': '`done'' unexpected',
+ \ 'type': 'E',
+ \ },
+ \ ],
+ \ ale_linters#sh#shell#Handle(347, [
+ \ 'bash: line 13: syntax error near unexpected token d',
+ \ 'bash: line 7: line 42: line 36:',
+ \ 'sh: 11: Syntax error: "(" unexpected',
+ \ 'qfm:95: parse error near `out=$(( $1 / 1024. )...',
+ \ 'qfm:22: :11: :33: :44:',
+ \ 'foo.sh: syntax error at line 9: `done'' unexpected',
+ \ ])