summaryrefslogtreecommitdiff
path: root/test/handler
diff options
context:
space:
mode:
authorNathan Henrie <n8henrie@users.noreply.github.com>2022-08-07 01:27:17 -0600
committerGitHub <noreply@github.com>2022-08-07 16:27:17 +0900
commit5063804d44fe149ed39149848f92b5960f4f7164 (patch)
treecab553ae5166a556ab5b2a57d81f86c29a97e707 /test/handler
parente10fcf22dcc0441da3c984e26ae2e467b0ae554f (diff)
downloadale-5063804d44fe149ed39149848f92b5960f4f7164.zip
Add openscad and sca2d support (#4205)
Diffstat (limited to 'test/handler')
-rw-r--r--test/handler/test_openscad_handler.vader76
1 files changed, 76 insertions, 0 deletions
diff --git a/test/handler/test_openscad_handler.vader b/test/handler/test_openscad_handler.vader
new file mode 100644
index 00000000..36071cc7
--- /dev/null
+++ b/test/handler/test_openscad_handler.vader
@@ -0,0 +1,76 @@
+Before:
+ call ale#test#SetDirectory('/testplugin/test/handler')
+
+ " Load sca2d
+ runtime ale_linters/openscad/sca2d.vim
+
+After:
+ call ale#test#RestoreDirectory()
+ call ale#linter#Reset()
+
+Execute(The openscad handler should handle sca2d output):
+ AssertEqual
+ \ [
+ \ {
+ \ 'filename': ale#path#Simplify(g:dir . '/awesome_project.scad'),
+ \ 'lnum': 7,
+ \ 'type': 'E',
+ \ 'col': 42,
+ \ 'text': 'Module `corcle` used but never defined.',
+ \ 'detail': 'E2002: Module `corcle` used but never defined.',
+ \ },
+ \ ],
+ \ ale#handlers#openscad#SCA2D_callback(bufnr(''), [
+ \ 'awesome_project.scad:7:42: E2002: Module `corcle` used but never defined.',
+ \ '',
+ \ 'SCA2D message summary',
+ \ '=====================',
+ \ 'Fatal errors: 0',
+ \ 'Errors: 1',
+ \ 'Warnings: 0',
+ \ 'Info: 0',
+ \ 'Depreciated 0',
+ \ ])
+
+ AssertEqual
+ \ [
+ \ {
+ \ 'filename': ale#path#Simplify(g:dir . '/awesome_project.scad'),
+ \ 'lnum': 1,
+ \ 'type': 'E',
+ \ 'col': 37,
+ \ 'text': 'Cannot read file due to syntax error: - No terminal matches ''}'' in the current parser context',
+ \ 'detail': 'F0001: Cannot read file due to syntax error: - No terminal matches ''}'' in the current parser context',
+ \ },
+ \ ],
+ \ ale#handlers#openscad#SCA2D_callback(bufnr(''), [
+ \ 'awesome_project.scad:1:1: F0001: Cannot read file due to syntax error:',
+ \ ' - No terminal matches ''}'' in the current parser context, at line 1 col 37',
+ \ ' - ',
+ \ ' - translate([ 0, 0, 0 ]) { circle(10) }',
+ \ ' - ^',
+ \ ' - Expected one of: ',
+ \ ' - * IF',
+ \ ' - * LET',
+ \ ' - * FOR',
+ \ ' - * FUNC_CALL_NAME',
+ \ ' - * TERMINATION',
+ \ ' - * STAR',
+ \ ' - * LBRACE',
+ \ ' - * BANG',
+ \ ' - * ASSIGN',
+ \ ' - * PERCENT',
+ \ ' - * HASH',
+ \ ' - * INTERSECTION_FOR',
+ \ ' - ',
+ \ 'If you belive this is a bug in SCA2D please report it to us.',
+ \ '',
+ \ '',
+ \ 'SCA2D message summary',
+ \ '=====================',
+ \ 'Fatal errors: 1',
+ \ 'Errors: 0',
+ \ 'Warnings: 0',
+ \ 'Info: 0',
+ \ 'Depreciated 0',
+ \ ])