]> git.madduck.net Git - etc/vim.git/blobdiff - .vim/bundle/ale/test/handler/test_atools_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_atools_handler.vader
diff --git a/.vim/bundle/ale/test/handler/test_atools_handler.vader b/.vim/bundle/ale/test/handler/test_atools_handler.vader
new file mode 100644 (file)
index 0000000..3c22672
--- /dev/null
@@ -0,0 +1,85 @@
+Before:
+  runtime autoload/ale/handlers/atools.vim
+
+After:
+  call ale#linter#Reset()
+
+Execute(The atools handler should handle basic errors or warings):
+  AssertEqual
+  \ [
+  \   {
+  \     'lnum': 2,
+  \     'text': 'trailing whitespace',
+  \     'type': 'E',
+  \     'code': 'AL8',
+  \   },
+  \   {
+  \     'lnum': 15,
+  \     'text': '$pkgname should not be used in the source url',
+  \     'type': 'W',
+  \     'code': 'AL29',
+  \   },
+  \ ],
+  \ ale#handlers#atools#Handle(bufnr(''), [
+  \   'IC:[AL8]:APKBUILD:2:trailing whitespace',
+  \   'MC:[AL29]:APKBUILD:15:$pkgname should not be used in the source url',
+  \ ])
+
+" Regardless of the severity, if the certainty is [P]ossible and not [C]ertain
+" or if regardless of the Certainty the Severity is not [I]mportant or [S]erious
+" then it must be a [W]arning
+Execute(If we are not Certain or Importantly Serious, be a Warning):
+  AssertEqual
+  \ [
+  \   {
+  \     'lnum': 3,
+  \     'text': 'This violation is Serious but Possible false positive, I am a Warning!',
+  \     'type': 'W',
+  \     'code': 'AL',
+  \   },
+  \   {
+  \     'lnum': 4,
+  \     'text': 'This violation is Important but Possible false positive, I am a Warning!',
+  \     'type': 'W',
+  \     'code': 'AL',
+  \   },
+  \   {
+  \     'lnum': 5,
+  \     'text': 'This violation is Minor, I am a Warning!',
+  \     'type': 'W',
+  \     'code': 'AL',
+  \   },
+  \   {
+  \     'lnum': 6,
+  \     'text': 'This violation is Style, I am a Warning!',
+  \     'type': 'W',
+  \     'code': 'AL',
+  \   },
+  \ ],
+  \ ale#handlers#atools#Handle(bufnr(''), [
+  \   'SP:[AL]:APKBUILD:3:This violation is Serious but Possible false positive, I am a Warning!',
+  \   'IP:[AL]:APKBUILD:4:This violation is Important but Possible false positive, I am a Warning!',
+  \   'MC:[AL]:APKBUILD:5:This violation is Minor, I am a Warning!',
+  \   'TC:[AL]:APKBUILD:6:This violation is Style, I am a Warning!',
+  \ ])
+
+Execute(We should be error if we are Certain it is Serious or Important):
+  AssertEqual
+  \ [
+  \   {
+  \     'lnum': 7,
+  \     'text': 'This is Certainly Serious, I am an Error!',
+  \     'type': 'E',
+  \     'code': 'AL',
+  \   },
+  \   {
+  \     'lnum': 8,
+  \     'text': 'This is Certainly Important, I am an Error!',
+  \     'type': 'E',
+  \     'code': 'AL',
+  \   },
+  \ ],
+  \ ale#handlers#atools#Handle(bufnr(''), [
+  \    'SC:[AL]:APKBUILD:7:This is Certainly Serious, I am an Error!',
+  \    'IC:[AL]:APKBUILD:8:This is Certainly Important, I am an Error!',
+  \ ])