]> git.madduck.net Git - etc/vim.git/blobdiff - .vim/bundle/ale/test/handler/test_mercury_mmc_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_mercury_mmc_handler.vader
diff --git a/.vim/bundle/ale/test/handler/test_mercury_mmc_handler.vader b/.vim/bundle/ale/test/handler/test_mercury_mmc_handler.vader
new file mode 100644 (file)
index 0000000..e862f28
--- /dev/null
@@ -0,0 +1,58 @@
+Before:
+  runtime ale_linters/mercury/mmc.vim
+
+After:
+  call ale#linter#Reset()
+
+Execute(The mmc handler should handle syntax errors):
+  AssertEqual
+  \ [
+  \   {
+  \     'lnum': 3,
+  \     'type': 'E',
+  \     'text': "Syntax error at token ',': operator precedence error."
+  \   }
+  \ ],
+  \ ale_linters#mercury#mmc#Handle(1, [
+  \    "file_name.m:003: Syntax error at token ',': operator precedence error."
+  \ ])
+
+Execute(The mmc handler should handle warnings):
+  AssertEqual
+  \ [
+  \   {
+  \     'lnum': 10,
+  \     'type': 'W',
+  \     'text': 'Warning: reference to uninitialized state variable !.X.'
+  \   },
+  \   {
+  \     'lnum': 12,
+  \     'type': 'W',
+  \     'text': 'warning: determinism declaration could be tighter.'
+  \   }
+  \ ],
+  \ ale_linters#mercury#mmc#Handle(1, [
+  \   'file_name.m:010: Warning: reference to uninitialized state variable !.X.',
+  \   "file_name.m:012: In `some_predicate':",
+  \   'file_name.m:012:    warning: determinism declaration could be tighter.'
+  \ ])
+
+Execute(The mmc handler should handle semantic errors):
+  AssertEqual
+  \ [
+  \   {
+  \     'lnum': 7,
+  \     'type': 'E',
+  \     'text': "error: undefined type `bar'/0."
+  \   },
+  \   {
+  \     'lnum': 15,
+  \     'type': 'E',
+  \     'text': "Error: circular equivalence type `file_name.foo'/0."
+  \   }
+  \ ],
+  \ ale_linters#mercury#mmc#Handle(1, [
+  \    "file_name.m:007: In clause for predicate `foldit'/4:",
+  \    "file_name.m:007:   error: undefined type `bar'/0.",
+  \    "file_name.m:015: Error: circular equivalence type `file_name.foo'/0."
+  \ ])