summaryrefslogtreecommitdiff
path: root/test/handler
diff options
context:
space:
mode:
authorMasashi Iizuka <liquidz.uo@gmail.com>2019-04-11 04:59:58 +0900
committerw0rp <w0rp@users.noreply.github.com>2019-04-10 20:59:58 +0100
commit481316561445a4048a96a2c6bd41e9b623d8919f (patch)
treed9dd770a6129f21506f940d7e0b10f652d25fd45 /test/handler
parent16b43a5708f993fc822c50053090a136578e1b33 (diff)
downloadale-481316561445a4048a96a2c6bd41e9b623d8919f.zip
Add a linter for clojure using clj-kondo (#2377)
Diffstat (limited to 'test/handler')
-rw-r--r--test/handler/test_clojure_clj_kondo_handler.vader75
1 files changed, 75 insertions, 0 deletions
diff --git a/test/handler/test_clojure_clj_kondo_handler.vader b/test/handler/test_clojure_clj_kondo_handler.vader
new file mode 100644
index 00000000..45db9049
--- /dev/null
+++ b/test/handler/test_clojure_clj_kondo_handler.vader
@@ -0,0 +1,75 @@
+Before:
+ runtime ale_linters/clojure/clj_kondo.vim
+
+After:
+ call ale#linter#Reset()
+
+Execute(the clojure clj-kondo handler should be able to handle errors):
+ AssertEqual
+ \ [
+ \ {
+ \ 'lnum': 123,
+ \ 'col': 44,
+ \ 'type': 'E',
+ \ 'text': 'error: Unexpected )',
+ \ },
+ \ ],
+ \ ale_linters#clojure#clj_kondo#HandleCljKondoFormat(0, [
+ \ 'test.clj:123:44: error: Unexpected )',
+ \ ])
+
+Execute(the clojure clj-kondo handler should be able to handle warnings):
+ AssertEqual
+ \ [
+ \ {
+ \ 'lnum': 654,
+ \ 'col': 321,
+ \ 'type': 'W',
+ \ 'text': 'warning: inline def',
+ \ }
+ \ ],
+ \ ale_linters#clojure#clj_kondo#HandleCljKondoFormat(0, [
+ \ 'test.clj:654:321: warning: inline def'
+ \ ])
+
+Execute(the clojure clj-kondo handler should be able to handle exceptions):
+ AssertEqual
+ \ [
+ \ {
+ \ 'lnum': 123,
+ \ 'col': 321,
+ \ 'type': 'E',
+ \ 'text': 'Exception: something horrible happen',
+ \ }
+ \ ],
+ \ ale_linters#clojure#clj_kondo#HandleCljKondoFormat(0, [
+ \ 'test.clj:123:321: Exception: something horrible happen'
+ \ ])
+
+Execute(the clojure clj-kondo handler should be able to handle errors from stdin):
+ AssertEqual
+ \ [
+ \ {
+ \ 'lnum': 16,
+ \ 'col': 1,
+ \ 'type': 'E',
+ \ 'text': 'error: Unexpected )',
+ \ },
+ \ ],
+ \ ale_linters#clojure#clj_kondo#HandleCljKondoFormat(0, [
+ \ '<stdin>:16:1: error: Unexpected )',
+ \ ])
+
+Execute(the clojure clj-kondo handler should be able to handle windows files):
+ AssertEqual
+ \ [
+ \ {
+ \ 'lnum': 123,
+ \ 'col': 44,
+ \ 'type': 'E',
+ \ 'text': 'error: Unexpected )',
+ \ }
+ \ ],
+ \ ale_linters#clojure#clj_kondo#HandleCljKondoFormat(0, [
+ \ 'C:\my\operating\system\is\silly\core.clj:123:44: error: Unexpected )',
+ \ ])