This repository has been archived on 2024-07-19. You can view files and clone it, but cannot push or open issues or pull requests.
ale/test/handler/test_redpen_handler.vader

70 lines
1.9 KiB
Text
Raw Normal View History

2017-11-16 09:36:53 +00:00
Before:
runtime! ale_linters/markdown/redpen.vim
After:
call ale#linter#Reset()
Execute(redpen handler should handle errors output):
AssertEqual
\ [
\ {
\ 'lnum': 1,
2017-11-17 06:21:54 +00:00
\ 'col': 10,
\ 'end_lnum': 1,
\ 'end_col': 15,
\ 'text': 'Found possibly misspelled word "plugin".',
2017-11-16 09:36:53 +00:00
\ 'type': 'W',
\ 'code': 'Spelling',
2017-11-16 09:36:53 +00:00
\ },
\ {
\ 'lnum': 1,
\ 'col': 1,
\ 'text': 'Found possibly misspelled word "NeoVim".',
2017-11-16 09:36:53 +00:00
\ 'type': 'W',
\ 'code': 'Spelling',
2017-11-16 09:36:53 +00:00
\ },
\ ],
\ ale#handlers#redpen#HandleRedpenOutput(bufnr(''), [
2017-11-16 09:36:53 +00:00
\ '[',
\ ' {',
\ ' "document": "test.md",',
\ ' "errors": [',
\ ' {',
\ ' "sentence": "ALE is a plugin for providing linting in NeoVim and Vim 8 while you edit your text files.",',
\ ' "endPosition": {',
\ ' "offset": 15,',
\ ' "lineNum": 1',
\ ' },',
\ ' "validator": "Spelling",',
\ ' "lineNum": 1,',
\ ' "sentenceStartColumnNum": 0,',
\ ' "message": "Found possibly misspelled word \"plugin\".",',
\ ' "startPosition": {',
\ ' "offset": 9,',
\ ' "lineNum": 1',
\ ' }',
\ ' },',
\ ' {',
\ ' "sentence": "ALE is a plugin for providing linting in NeoVim and Vim 8 while you edit your text files.",',
\ ' "validator": "Spelling",',
\ ' "lineNum": 1,',
\ ' "sentenceStartColumnNum": 0,',
\ ' "message": "Found possibly misspelled word \"NeoVim\"."',
2017-11-16 09:36:53 +00:00
\ ' }',
\ ' ]',
\ ' }',
\ ']',
\ ])
Execute(redpen handler should no error output):
AssertEqual
\ [],
\ ale#handlers#redpen#HandleRedpenOutput(bufnr(''), [
2017-11-16 09:36:53 +00:00
\ '[',
\ ' {',
\ ' "document": "test.md",',
\ ' "errors": []',
\ ' }',
\ ']',
\ ])