summaryrefslogtreecommitdiff
path: root/test/handler
diff options
context:
space:
mode:
Diffstat (limited to 'test/handler')
-rw-r--r--test/handler/test_gawk_handler.vader39
1 files changed, 39 insertions, 0 deletions
diff --git a/test/handler/test_gawk_handler.vader b/test/handler/test_gawk_handler.vader
new file mode 100644
index 00000000..3a7b5457
--- /dev/null
+++ b/test/handler/test_gawk_handler.vader
@@ -0,0 +1,39 @@
+Before:
+ runtime ale_linters/awk/gawk.vim
+
+After:
+ call ale#linter#Reset()
+
+Execute(gawk syntax errors should be parsed correctly):
+
+ AssertEqual
+ \ [
+ \ {
+ \ 'lnum': 1,
+ \ 'col': 0,
+ \ 'text': "invalid char ''' in expression",
+ \ 'code': 0,
+ \ 'type': 'E',
+ \ },
+ \ {
+ \ 'lnum': 5,
+ \ 'col': 0,
+ \ 'text': 'unterminated string',
+ \ 'code': 0,
+ \ 'type': 'E',
+ \ },
+ \ {
+ \ 'lnum': 10,
+ \ 'col': 0,
+ \ 'text': "escape sequence `\u' treated as plain `u'",
+ \ 'code': 0,
+ \ 'type': 'W',
+ \ },
+ \ ],
+ \ ale#handlers#gawk#HandleGawkFormat(347, [
+ \ "gawk: something.awk:1: BEGIN { system('touch aaaaaaaaa') }",
+ \ "gawk: something.awk:1: ^ invalid char ''' in expression",
+ \ 'gawk: something.awk:5: { x = "aaaaaaaaaaa',
+ \ 'gawk: something.awk:5: ^ unterminated string',
+ \ "gawk: something.awk:10: warning: escape sequence `\u' treated as plain `u'",
+ \ ])