summaryrefslogtreecommitdiff
path: root/test/handler
diff options
context:
space:
mode:
authorjiangzhi.xie <xiejiangzhi@gmail.com>2018-01-08 23:19:17 +0800
committerjiangzhi.xie <xiejiangzhi@gmail.com>2018-01-08 23:32:02 +0800
commit112fcf7dd57a077f70ae39bb03d192f5c832aa2e (patch)
tree7f869ba3afaec822893b7e0a2856877a05153158 /test/handler
parentf1747901cc00abb7becb64c02bfccad46b66ed21 (diff)
downloadale-112fcf7dd57a077f70ae39bb03d192f5c832aa2e.zip
Add a luac linter for Lua
Diffstat (limited to 'test/handler')
-rw-r--r--test/handler/test_luac_handler.vader36
-rw-r--r--test/handler/test_luacheck_handler.vader (renamed from test/handler/test_lua_handler.vader)0
2 files changed, 36 insertions, 0 deletions
diff --git a/test/handler/test_luac_handler.vader b/test/handler/test_luac_handler.vader
new file mode 100644
index 00000000..3a2e769c
--- /dev/null
+++ b/test/handler/test_luac_handler.vader
@@ -0,0 +1,36 @@
+Before:
+ Save g:ale_warn_about_trailing_whitespace
+
+ let g:ale_warn_about_trailing_whitespace = 1
+
+ runtime ale_linters/lua/luac.vim
+
+After:
+ Restore
+ call ale#linter#Reset()
+
+Execute(The luac handler should parse lines correctly):
+ AssertEqual
+ \ [
+ \ {
+ \ 'lnum': 1,
+ \ 'text': 'line contains trailing whitespace',
+ \ 'type': 'E',
+ \ },
+ \ {
+ \ 'lnum': 3,
+ \ 'text': 'unexpected symbol near ''-''',
+ \ 'type': 'E',
+ \ },
+ \ {
+ \ 'lnum': 5,
+ \ 'text': '''='' expected near '')''',
+ \ 'type': 'E',
+ \ },
+ \ ],
+ \ ale_linters#lua#luac#Handle(347, [
+ \ 'luac /file/path/here.lua:1: line contains trailing whitespace',
+ \ 'luac /file/path/here.lua:3: unexpected symbol near ''-''',
+ \ 'luac /file/path/here.lua:5: ''='' expected near '')''',
+ \ ])
+
diff --git a/test/handler/test_lua_handler.vader b/test/handler/test_luacheck_handler.vader
index 7cebb017..7cebb017 100644
--- a/test/handler/test_lua_handler.vader
+++ b/test/handler/test_luacheck_handler.vader