summaryrefslogtreecommitdiff
path: root/test/handler/test_lua_selene_handler.vader
diff options
context:
space:
mode:
authorzandr <7629614+deathlyfrantic@users.noreply.github.com>2022-04-29 22:11:12 -0400
committerGitHub <noreply@github.com>2022-04-30 11:11:12 +0900
commit57e16957e0e4c4293603bffc5014dc6bc72e9256 (patch)
tree8865c09598f8dbb527521eb995fba893164aad1a /test/handler/test_lua_selene_handler.vader
parent3348222abccb8ed9555cafe6983cf04754340362 (diff)
downloadale-57e16957e0e4c4293603bffc5014dc6bc72e9256.zip
Add support for selene Lua linter (#4169)
Diffstat (limited to 'test/handler/test_lua_selene_handler.vader')
-rw-r--r--test/handler/test_lua_selene_handler.vader38
1 files changed, 38 insertions, 0 deletions
diff --git a/test/handler/test_lua_selene_handler.vader b/test/handler/test_lua_selene_handler.vader
new file mode 100644
index 00000000..e9410ae9
--- /dev/null
+++ b/test/handler/test_lua_selene_handler.vader
@@ -0,0 +1,38 @@
+Before:
+ runtime ale_linters/lua/selene.vim
+
+After:
+ Restore
+ call ale#linter#Reset()
+
+Execute(The selene handler for Lua should parse input correctly):
+ AssertEqual
+ \ [
+ \ {
+ \ 'lnum': 1,
+ \ 'end_lnum': 2,
+ \ 'col': 1,
+ \ 'end_col': 3,
+ \ 'text': 'empty if block',
+ \ 'code': 'empty_if',
+ \ 'type': 'W',
+ \ },
+ \ {
+ \ 'lnum': 1,
+ \ 'end_lnum': 1,
+ \ 'col': 4,
+ \ 'end_col': 11,
+ \ 'text': 'comparing things to nan directly is not allowed',
+ \ 'code': 'compare_nan',
+ \ 'type': 'E',
+ \ 'detail': "comparing things to nan directly is not allowed\n\ntry: `x ~= x` instead"
+ \ },
+ \ ],
+ \ ale_linters#lua#selene#Handle(0, [
+ \ '{"severity":"Warning","code":"empty_if","message":"empty if block","primary_label":{"span":{"start":0,"start_line":0,"start_column":0,"end":20,"end_line":1,"end_column":3},"message":""},"notes":[],"secondary_labels":[]}',
+ \ '{"severity":"Error","code":"compare_nan","message":"comparing things to nan directly is not allowed","primary_label":{"span":{"start":3,"start_line":0,"start_column":3,"end":11,"end_line":0,"end_column":11},"message":""},"notes":["try: `x ~= x` instead"],"secondary_labels":[]}',
+ \ 'Results:',
+ \ '1 errors',
+ \ '1 warnings',
+ \ '0 parse errors',
+ \ ])