summaryrefslogtreecommitdiff
path: root/test/handler/test_shellcheck_handler.vader
diff options
context:
space:
mode:
authorw0rp <devw0rp@gmail.com>2017-11-13 16:08:09 +0000
committerw0rp <devw0rp@gmail.com>2017-11-13 16:08:09 +0000
commit6c112dd1cc0225d2549f364b5e8a7693755634c2 (patch)
tree00ab4f019d336f1bf538c528cf4f0390be2aacd5 /test/handler/test_shellcheck_handler.vader
parenta5f7f51c9a13f103a51cb91b6abdd53fade3600a (diff)
downloadale-6c112dd1cc0225d2549f364b5e8a7693755634c2.zip
Fix #1122 - Handle notes for shellcheck errors again, and use type 'I' for notes
Diffstat (limited to 'test/handler/test_shellcheck_handler.vader')
-rw-r--r--test/handler/test_shellcheck_handler.vader40
1 files changed, 40 insertions, 0 deletions
diff --git a/test/handler/test_shellcheck_handler.vader b/test/handler/test_shellcheck_handler.vader
new file mode 100644
index 00000000..5a7607e8
--- /dev/null
+++ b/test/handler/test_shellcheck_handler.vader
@@ -0,0 +1,40 @@
+Before:
+ runtime ale_linters/shell/shellcheck.vim
+
+After:
+ call ale#linter#Reset()
+
+Execute(The shellcheck handler should handle basic errors or warnings):
+ AssertEqual
+ \ [
+ \ {
+ \ 'lnum': 2,
+ \ 'col': 1,
+ \ 'type': 'W',
+ \ 'text': 'In POSIX sh, ''let'' is not supported. [SC2039]',
+ \ },
+ \ {
+ \ 'lnum': 2,
+ \ 'col': 3,
+ \ 'type': 'E',
+ \ 'text': 'Don''t put spaces around the = in assignments. [SC1068]',
+ \ },
+ \ ],
+ \ ale_linters#sh#shellcheck#Handle(bufnr(''), [
+ \ '-:2:1: warning: In POSIX sh, ''let'' is not supported. [SC2039]',
+ \ '-:2:3: error: Don''t put spaces around the = in assignments. [SC1068]',
+ \ ])
+
+Execute(The shellcheck handler should handle notes):
+ AssertEqual
+ \ [
+ \ {
+ \ 'lnum': 3,
+ \ 'col': 3,
+ \ 'type': 'I',
+ \ 'text': 'Double quote to prevent globbing and word splitting. [SC2086]',
+ \ },
+ \ ],
+ \ ale_linters#sh#shellcheck#Handle(bufnr(''), [
+ \ '-:3:3: note: Double quote to prevent globbing and word splitting. [SC2086]',
+ \ ])