summaryrefslogtreecommitdiff
path: root/test/handler/test_lacheck_handler.vader
blob: 5d1b6ace57314f94678e94bc3cf2216a130467a4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
Before:
  runtime ale_linters/tex/lacheck.vim
  call ale#test#SetDirectory('/testplugin/test/handler')

After:
  call ale#linter#Reset()
  call ale#test#RestoreDirectory()

Execute(The lacheck handler should parse lines correctly):
  call ale#test#SetFilename('../test-files/tex/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\""
  \ ])