summaryrefslogtreecommitdiff
path: root/test/handler
diff options
context:
space:
mode:
authorw0rp <w0rp@users.noreply.github.com>2018-04-05 12:34:45 +0100
committerGitHub <noreply@github.com>2018-04-05 12:34:45 +0100
commit8baab691e9bba61d928388572725b72aa5ce9268 (patch)
treeb83a28e7ba5563bc8c31e9d7b1993bd625cd9717 /test/handler
parent95ec9bb780198d0ebc0f175debc286b43dd5fc27 (diff)
parent8d4852a127d9f4d9793f8ee585fdb18a916aa7e9 (diff)
downloadale-8baab691e9bba61d928388572725b72aa5ce9268.zip
Merge pull request #1429 from stewy33/master
Add support for Mercury language using mmc as a linter.
Diffstat (limited to 'test/handler')
-rw-r--r--test/handler/test_mercury_mmc_handler.vader58
1 files changed, 58 insertions, 0 deletions
diff --git a/test/handler/test_mercury_mmc_handler.vader b/test/handler/test_mercury_mmc_handler.vader
new file mode 100644
index 00000000..e862f287
--- /dev/null
+++ b/test/handler/test_mercury_mmc_handler.vader
@@ -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."
+ \ ])