/ test / handler / test_languagetool_handler.vader
test_languagetool_handler.vader
 1  Before:
 2    runtime! ale_linters/text/languagetool.vim
 3  
 4  After:
 5    call ale#linter#Reset()
 6  
 7  Execute(languagetool handler should report 3 errors):
 8    AssertEqual
 9    \ [
10    \   {
11    \     'lnum': 3,
12    \     'col': 19,
13    \     'end_col': 20,
14    \     'text': 'This sentence does not start with an uppercase letter',
15    \     'type': 'W',
16    \     'code': 'UPPERCASE_SENTENCE_START',
17    \   },
18    \   {
19    \     'lnum': 3,
20    \     'col': 36,
21    \     'end_col': 42,
22    \     'text': "Did you mean 'to see'?",
23    \     'type': 'W',
24    \     'code': 'TOO_TO[1]',
25    \   },
26    \   {
27    \     'lnum': 3,
28    \     'col': 44,
29    \     'end_col': 45,
30    \     'text': "Use 'a' instead of 'an' if the following word doesn't start with a vowel sound, e.g. 'a sentence', 'a university'",
31    \     'type': 'W',
32    \     'code': 'EN_A_VS_AN',
33    \   }
34    \ ],
35    \ ale#handlers#languagetool#HandleOutput(bufnr(''), [
36    \ '1.) Line 3, column 19, Rule ID: UPPERCASE_SENTENCE_START',
37    \ 'Message: This sentence does not start with an uppercase letter',
38    \ 'Suggestion: Or',
39    \ '...red phrases for details on potential errors. or use this text too see an few of of the probl...',
40    \ '                                                ^^                                             ',
41    \ '',
42    \ '2.) Line 3, column 36, Rule ID: TOO_TO[1]',
43    \ "Message: Did you mean 'to see'?",
44    \ 'Suggestion: to see',
45    \ '...etails on potential errors. or use this text too see an few of of the problems that LanguageTool ...',
46    \ '                                                ^^^^^^^                                             ',
47    \ '',
48    \ '3.) Line 3, column 44, Rule ID: EN_A_VS_AN',
49    \ "Message: Use 'a' instead of 'an' if the following word doesn't start with a vowel sound, e.g. 'a sentence', 'a university'",
50    \ 'Suggestion: a',
51    \ '...n potential errors. or use this text too see an few of of the problems that LanguageTool can...',
52    \ '                                               ^^                                             ',
53    \ 'Time: 2629ms for 8 sentences (3.0 sentences/sec)'
54    \ ])
55  
56  Execute(languagetool handler should report no errors on empty input):
57    AssertEqual
58    \ [],
59    \ ale#handlers#languagetool#HandleOutput(bufnr(''), [
60    \ '',
61    \ 'Time: 2629ms for 8 sentences (3.0 sentences/sec)'
62    \ ])