summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorHoracio Sanson <hsanson@gmail.com>2021-01-13 23:54:06 +0900
committerGitHub <noreply@github.com>2021-01-13 23:54:06 +0900
commit97ce2423b04745d5c7588385ddbd75be9ef846d4 (patch)
tree57268e48efdc93900cb41bb2194e1128b6d26c0e /test
parent7b187af10abd2f8984e1ca061c30244a8a0bdb60 (diff)
parent8375ee2766c4d69462b8c883ddf76d58a86891e4 (diff)
downloadale-97ce2423b04745d5c7588385ddbd75be9ef846d4.zip
Merge pull request #3494 from YorickPeterse/master
Add linter for Inko
Diffstat (limited to 'test')
-rw-r--r--test/command_callback/inko_paths/test.inko0
-rw-r--r--test/command_callback/inko_paths/tests/test/test_foo.inko0
-rw-r--r--test/command_callback/test_inko_inko_callbacks.vader20
-rw-r--r--test/handler/test_inko_handler.vader54
4 files changed, 74 insertions, 0 deletions
diff --git a/test/command_callback/inko_paths/test.inko b/test/command_callback/inko_paths/test.inko
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/test/command_callback/inko_paths/test.inko
diff --git a/test/command_callback/inko_paths/tests/test/test_foo.inko b/test/command_callback/inko_paths/tests/test/test_foo.inko
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/test/command_callback/inko_paths/tests/test/test_foo.inko
diff --git a/test/command_callback/test_inko_inko_callbacks.vader b/test/command_callback/test_inko_inko_callbacks.vader
new file mode 100644
index 00000000..93295c91
--- /dev/null
+++ b/test/command_callback/test_inko_inko_callbacks.vader
@@ -0,0 +1,20 @@
+Before:
+ call ale#assert#SetUpLinterTest('inko', 'inko')
+ call ale#test#SetFilename('inko_paths/test.inko')
+
+After:
+ call ale#assert#TearDownLinterTest()
+
+Execute(The default executable path should be correct):
+ AssertLinter 'inko', ale#Escape('inko') . ' build --check --format=json %s'
+
+Execute(The inko callback should include tests/ for test paths):
+ call ale#engine#Cleanup(bufnr(''))
+ noautocmd e! inko_paths/tests/test/test_foo.inko
+ call ale#engine#InitBufferInfo(bufnr(''))
+
+ AssertLinter 'inko',
+ \ ale#Escape('inko')
+ \ . ' build --check --format=json --include '
+ \ . ale#Escape(ale#path#Simplify(g:dir . '/inko_paths/tests/'))
+ \ . ' %s'
diff --git a/test/handler/test_inko_handler.vader b/test/handler/test_inko_handler.vader
new file mode 100644
index 00000000..6621d2d6
--- /dev/null
+++ b/test/handler/test_inko_handler.vader
@@ -0,0 +1,54 @@
+Before:
+ runtime ale_linters/inko/inko.vim
+
+After:
+ call ale#linter#Reset()
+
+Execute(The inko handler should parse errors correctly):
+ AssertEqual
+ \ [
+ \ {
+ \ 'filename': ale#path#Simplify('/tmp/foo.inko'),
+ \ 'lnum': 4,
+ \ 'col': 5,
+ \ 'text': 'this is an error',
+ \ 'type': 'E',
+ \ }
+ \ ],
+ \ ale#handlers#inko#Handle(bufnr(''), [
+ \ '[',
+ \ ' {',
+ \ ' "file": "/tmp/foo.inko",',
+ \ ' "line": 4,',
+ \ ' "column": 5,',
+ \ ' "message": "this is an error",',
+ \ ' "level": "error"',
+ \ ' }',
+ \ ']'
+ \ ])
+
+Execute(The inko handler should parse warnings correctly):
+ AssertEqual
+ \ [
+ \ {
+ \ 'filename': ale#path#Simplify('/tmp/foo.inko'),
+ \ 'lnum': 4,
+ \ 'col': 5,
+ \ 'text': 'this is a warning',
+ \ 'type': 'W',
+ \ }
+ \ ],
+ \ ale#handlers#inko#Handle(bufnr(''), [
+ \ '[',
+ \ ' {',
+ \ ' "file": "/tmp/foo.inko",',
+ \ ' "line": 4,',
+ \ ' "column": 5,',
+ \ ' "message": "this is a warning",',
+ \ ' "level": "warning"',
+ \ ' }',
+ \ ']'
+ \ ])
+
+Execute(The inko handler should handle empty output):
+ AssertEqual [], ale#handlers#inko#Handle(bufnr(''), [])