]> git.madduck.net Git - etc/vim.git/blobdiff - .vim/bundle/ale/test/handler/test_redpen_handler.vader

madduck's git repository

Every one of the projects in this repository is available at the canonical URL git://git.madduck.net/madduck/pub/<projectpath> — see each project's metadata for the exact URL.

All patches and comments are welcome. Please squash your changes to logical commits before using git-format-patch and git-send-email to patches@git.madduck.net. If you'd read over the Git project's submission guidelines and adhered to them, I'd be especially grateful.

SSH access, as well as push access can be individually arranged.

If you use my repositories frequently, consider adding the following snippet to ~/.gitconfig and using the third clone URL listed for each project:

[url "git://git.madduck.net/madduck/"]
  insteadOf = madduck:

Merge commit '76265755a1add77121c8f9dabb3e9bb70fe9a972' as '.vim/bundle/ale'
[etc/vim.git] / .vim / bundle / ale / test / handler / test_redpen_handler.vader
diff --git a/.vim/bundle/ale/test/handler/test_redpen_handler.vader b/.vim/bundle/ale/test/handler/test_redpen_handler.vader
new file mode 100644 (file)
index 0000000..0b030e2
--- /dev/null
@@ -0,0 +1,98 @@
+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',
+  \   },
+  \   {
+  \     'lnum': 1,
+  \     'col': 35,
+  \     'end_lnum': 1,
+  \     'end_col': 55,
+  \     'text': 'Found possibly misspelled word "コードチェック".',
+  \     '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\"."',
+  \   '      },',
+  \   '      {',
+  \   '        "sentence": "ALEはNeoVimとVim8で非同期のコードチェックを実現するプラグインです。",',
+  \   '        "endPosition": {',
+  \   '          "offset": 27,',
+  \   '          "lineNum": 1',
+  \   '        },',
+  \   '        "validator": "Spelling",',
+  \   '        "lineNum": 1,',
+  \   '        "sentenceStartColumnNum": 0,',
+  \   '        "message": "Found possibly misspelled word \"コードチェック\".",',
+  \   '        "startPosition": {',
+  \   '          "offset": 20,',
+  \   '          "lineNum": 1',
+  \   '        }',
+  \   '      }',
+  \   '    ]',
+  \   '  }',
+  \   ']',
+  \ ])
+
+Execute(The redpen handler should handle an empty error list):
+  AssertEqual
+  \ [],
+  \ ale#handlers#redpen#HandleRedpenOutput(bufnr(''), [
+  \   '[',
+  \   '  {',
+  \   '    "document": "test.md",',
+  \   '    "errors": []',
+  \   '  }',
+  \   ']',
+  \ ])
+
+Execute(The redpen handler should handle totally empty output):
+  AssertEqual
+  \ [],
+  \ ale#handlers#redpen#HandleRedpenOutput(bufnr(''), [])