diff options
author | Horacio Sanson <horacio@allm.net> | 2018-12-11 23:44:06 +0900 |
---|---|---|
committer | Horacio Sanson <horacio@allm.net> | 2018-12-11 23:44:06 +0900 |
commit | 5052eca5cb59389275ff1341525214228bad324a (patch) | |
tree | 6ffb0acf40f7d20ae7f31a85d81a58f16dbf9b45 /test/handler | |
parent | a6a8c90126e83378280a21a01f947ef0a8f1af8a (diff) | |
download | ale-5052eca5cb59389275ff1341525214228bad324a.zip |
Add tests to lacheck linter
Diffstat (limited to 'test/handler')
-rw-r--r-- | test/handler/test_lacheck_handler.vader | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/test/handler/test_lacheck_handler.vader b/test/handler/test_lacheck_handler.vader new file mode 100644 index 00000000..0bcc3be8 --- /dev/null +++ b/test/handler/test_lacheck_handler.vader @@ -0,0 +1,36 @@ +Before: + runtime ale_linters/tex/lacheck.vim + call ale#test#SetDirectory('/testplugin/test') + +After: + call ale#linter#Reset() + call ale#test#RestoreDirectory() + +Execute(The lacheck handler should parse lines correctly): + + call ale#test#SetFilename('command_callback/tex_paths/sample1.tex') + + AssertEqual + \ [ + \ { + \ 'lnum': 1, + \ 'type': 'W', + \ 'text': 'perhaps you should insert a `~'' before "\ref"' + \ } + \ ], + \ ale_linters#tex#lacheck#Handle(bufnr(''), [ + \ "** sample1:", + \ "\"sample1.tex\", line 1: perhaps you should insert a `~' before \"\\ref\"" + \ ]) + +Execute(The lacheck handler should ignore errors from input files): + + call ale#test#SetFilename('ale_test.tex') + + AssertEqual + \ [ + \ ], + \ ale_linters#tex#lacheck#Handle(255, [ + \ "** ale_input:", + \ "\"ale_input.tex\", line 1: perhaps you should insert a `~' before \"\\ref\"" + \ ]) |