summaryrefslogtreecommitdiff
path: root/test/handler/test_redpen_handler.vader
diff options
context:
space:
mode:
authorrhysd <lin90162@yahoo.co.jp>2017-11-16 18:36:53 +0900
committerrhysd <lin90162@yahoo.co.jp>2017-11-16 18:40:10 +0900
commitc9c52ef370f6abbcf60220e047faebd294bd738b (patch)
tree90089d17b6d2584607987dc5bb36c991f028fa34 /test/handler/test_redpen_handler.vader
parent981cb95d80714fd70b55d99f164c2d3158315206 (diff)
downloadale-c9c52ef370f6abbcf60220e047faebd294bd738b.zip
add tests and doc for redpen support
Diffstat (limited to 'test/handler/test_redpen_handler.vader')
-rw-r--r--test/handler/test_redpen_handler.vader65
1 files changed, 65 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..2ea3a2ff
--- /dev/null
+++ b/test/handler/test_redpen_handler.vader
@@ -0,0 +1,65 @@
+Before:
+ runtime! ale_linters/markdown/redpen.vim
+
+After:
+ call ale#linter#Reset()
+
+Execute(redpen handler should handle errors output):
+ AssertEqual
+ \ [
+ \ {
+ \ 'lnum': 1,
+ \ 'col': 9,
+ \ '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": []',
+ \ ' }',
+ \ ']',
+ \ ])