mirror of
https://github.com/dense-analysis/ale.git
synced 2025-12-25 21:41:10 +08:00
Merge pull request #2136 from hsanson/368-chktex-latex-report-errors-from-wrong-file
Fix 368 - Lacheck reports errors from input{} files.
This commit is contained in:
36
test/handler/test_lacheck_handler.vader
Normal file
36
test/handler/test_lacheck_handler.vader
Normal file
@@ -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\""
|
||||
\ ])
|
||||
Reference in New Issue
Block a user