summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorw0rp <w0rp@users.noreply.github.com>2019-02-06 22:04:47 +0000
committerGitHub <noreply@github.com>2019-02-06 22:04:47 +0000
commitc0c634c5eccfee6b5fd3ba7e6d506c345abc3e21 (patch)
treec7be5564415dd003e610328a8e5914c857462b1b /test
parent81c73da3b98455c4ad11f32208dac3dcfa6e0da7 (diff)
parent626572a53962d47545fcc67e2045d3eb984cbef1 (diff)
downloadale-c0c634c5eccfee6b5fd3ba7e6d506c345abc3e21.zip
Merge pull request #2270 from oblitum/add-cypher-lint
linter/cypher: add cypher-lint
Diffstat (limited to 'test')
-rw-r--r--test/command_callback/test_cypher_cypher_lint_command_callback.vader8
-rw-r--r--test/handler/test_cypher_lint_handler.vader21
2 files changed, 29 insertions, 0 deletions
diff --git a/test/command_callback/test_cypher_cypher_lint_command_callback.vader b/test/command_callback/test_cypher_cypher_lint_command_callback.vader
new file mode 100644
index 00000000..461ef295
--- /dev/null
+++ b/test/command_callback/test_cypher_cypher_lint_command_callback.vader
@@ -0,0 +1,8 @@
+Before:
+ call ale#assert#SetUpLinterTest('cypher', 'cypher_lint')
+
+After:
+ call ale#assert#TearDownLinterTest()
+
+Execute(The default command and executable should be correct):
+ AssertLinter 'cypher-lint', 'cypher-lint %s'
diff --git a/test/handler/test_cypher_lint_handler.vader b/test/handler/test_cypher_lint_handler.vader
new file mode 100644
index 00000000..066adae4
--- /dev/null
+++ b/test/handler/test_cypher_lint_handler.vader
@@ -0,0 +1,21 @@
+Before:
+ runtime ale_linters/cypher/cypher_lint.vim
+
+After:
+ call ale#linter#Reset()
+
+Execute(The cypher-lint handler should handle errors for the current file correctly):
+ AssertEqual
+ \ [
+ \ {
+ \ 'lnum': 1,
+ \ 'col': 75,
+ \ 'type': 'E',
+ \ 'text': "Invalid input ',': expected an identifier, shortestPath, allShortestPaths or '('",
+ \ },
+ \ ],
+ \ ale_linters#cypher#cypher_lint#Handle(bufnr(''), [
+ \ "shakespeare.cql:1:75: Invalid input ',': expected an identifier, shortestPath, allShortestPaths or '('",
+ \ "CREATE (shakespeare:Author {firstname:'William', lastname:'Shakespeare'}),,",
+ \ " ^",
+ \ ])