/ test / handler / test_rstcheck_lint_handler.vader
test_rstcheck_lint_handler.vader
 1  Before:
 2    runtime ale_linters/rst/rstcheck.vim
 3  
 4  After:
 5    call ale#linter#Reset()
 6  
 7  Execute(Warning and error messages should be handled correctly):
 8    " For some reason we can't set the directory such that the filenames are
 9    " correct here when running the tests from the Docker image, so we have to
10    " just check the basenames of the files instead.
11    AssertEqual
12    \ [
13    \   {
14    \      'filename': 'bad_python.rst',
15    \      'lnum': 7,
16    \      'col': 0,
17    \      'type': 'W',
18    \      'text': '(python) unexpected EOF while parsing',
19    \   },
20    \   {
21    \      'filename': 'bad_cpp.rst',
22    \      'lnum': 9,
23    \      'col': 0,
24    \      'type': 'W',
25    \      'text': '(cpp) error: ''x'' was not declared in this scope',
26    \   },
27    \   {
28    \      'filename': 'bad_rst.rst',
29    \      'lnum': 1,
30    \      'col': 0,
31    \      'type': 'E',
32    \      'text': 'Title overline & underline mismatch.',
33    \   },
34    \ ],
35    \ map(
36    \   ale_linters#rst#rstcheck#Handle(1, [
37    \     'bad_python.rst:7: (ERROR/3) (python) unexpected EOF while parsing',
38    \     'bad_cpp.rst:9: (ERROR/3) (cpp) error: ''x'' was not declared in this scope',
39    \     'bad_rst.rst:1: (SEVERE/4) Title overline & underline mismatch.',
40    \   ]),
41    \   'extend(v:val, {''filename'': fnamemodify(v:val.filename, '':t'')})'
42    \ )