summaryrefslogtreecommitdiff
path: root/test/handler
diff options
context:
space:
mode:
authorw0rp <w0rp@users.noreply.github.com>2017-11-16 10:44:52 +0000
committerGitHub <noreply@github.com>2017-11-16 10:44:52 +0000
commit3ddb858881c7b18ec8dae03ab915e5bb453f0286 (patch)
treec2d2cd9c3ba58043b499407cdd80ab0e3e3b1b08 /test/handler
parentf90a2d54744d7bfe985b0cd48a00012afecdc754 (diff)
parente232ea07c23d3e6f1b6e621e896f27545e5b10c7 (diff)
downloadale-3ddb858881c7b18ec8dae03ab915e5bb453f0286.zip
Merge pull request #1137 from rhysd/redpen
Add Redpen support
Diffstat (limited to 'test/handler')
-rw-r--r--test/handler/test_redpen_handler.vader67
1 files changed, 67 insertions, 0 deletions
diff --git a/test/handler/test_redpen_handler.vader b/test/handler/test_redpen_handler.vader
new file mode 100644
index 00000000..d0782d90
--- /dev/null
+++ b/test/handler/test_redpen_handler.vader
@@ -0,0 +1,67 @@
+Before:
+ runtime! ale_linters/markdown/redpen.vim
+
+After:
+ call ale#linter#Reset()
+
+Execute(redpen handler should handle errors output):
+ AssertEqual
+ \ [
+ \ {
+ \ 'lnum': 1,
+ \ 'col': 9,
+ \ 'end_lnum': 1,
+ \ 'end_col': 15,
+ \ 'text': 'Found possibly misspelled word "plugin". (Spelling)',
+ \ 'type': 'W',
+ \ },
+ \ {
+ \ 'lnum': 1,
+ \ 'col': 1,
+ \ 'text': 'Found possibly misspelled word "NeoVim". (Spelling)',
+ \ 'type': 'W',
+ \ },
+ \ ],
+ \ ale_linters#markdown#redpen#HandleErrors(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_linters#markdown#redpen#HandleErrors(bufnr(''), [
+ \ '[',
+ \ ' {',
+ \ ' "document": "test.md",',
+ \ ' "errors": []',
+ \ ' }',
+ \ ']',
+ \ ])