ale/test/handler/test_redpen_handler.vader
rhysd d465b71362 redpen: use 'code' key to show validator
instead of embedding it into text
2017-11-21 15:49:04 +09:00

70 lines
1.9 KiB
Plaintext

Before:
runtime! ale_linters/markdown/redpen.vim
After:
call ale#linter#Reset()
Execute(redpen handler should handle errors output):
AssertEqual
\ [
\ {
\ 'lnum': 1,
\ 'col': 10,
\ 'end_lnum': 1,
\ 'end_col': 15,
\ 'text': 'Found possibly misspelled word "plugin".',
\ 'type': 'W',
\ 'code': 'Spelling',
\ },
\ {
\ 'lnum': 1,
\ 'col': 1,
\ 'text': 'Found possibly misspelled word "NeoVim".',
\ 'type': 'W',
\ 'code': 'Spelling',
\ },
\ ],
\ ale#handlers#redpen#HandleRedpenOutput(bufnr(''), [
\ '[',
\ ' {',
\ ' "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\"."',
\ ' }',
\ ' ]',
\ ' }',
\ ']',
\ ])
Execute(redpen handler should no error output):
AssertEqual
\ [],
\ ale#handlers#redpen#HandleRedpenOutput(bufnr(''), [
\ '[',
\ ' {',
\ ' "document": "test.md",',
\ ' "errors": []',
\ ' }',
\ ']',
\ ])