summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorUtkarsh Verma <utkarshverma@protonmail.com>2021-11-15 16:11:03 +0530
committerGitHub <noreply@github.com>2021-11-15 19:41:03 +0900
commit1e0e76bf9619a3ce21663165283f9971556c95b3 (patch)
treef54e5099ef6b248502a039e07d840348c3a9a05a /test
parent76c2293e68a6cad3b192062743d25b8daa082205 (diff)
downloadale-1e0e76bf9619a3ce21663165283f9971556c95b3.zip
Add support for AVRA linting (#3950)
* Add support for AVRA linting * Add tests for AVRA linting and improve code * Fix test * Fix warning detection * Fix test * Fix test * Add AVRA as a supported language in docs
Diffstat (limited to 'test')
-rw-r--r--test/handler/test_avra_handler.vader24
-rw-r--r--test/linter/test_avra_avra.vader29
2 files changed, 53 insertions, 0 deletions
diff --git a/test/handler/test_avra_handler.vader b/test/handler/test_avra_handler.vader
new file mode 100644
index 00000000..0de83fb8
--- /dev/null
+++ b/test/handler/test_avra_handler.vader
@@ -0,0 +1,24 @@
+Before:
+ runtime ale_linters/avra/avra.vim
+
+After:
+ call ale#linter#Reset()
+
+Execute(The avra handler should parse errors correctly):
+ AssertEqual
+ \ [
+ \ {
+ \ 'lnum': 3,
+ \ 'text': "Unknown device: atmega3228p",
+ \ 'type': 'E'
+ \ },
+ \ {
+ \ 'lnum': 12,
+ \ 'text': "Unknown directive: .EQ",
+ \ 'type': 'E'
+ \ }
+ \ ],
+ \ ale_linters#avra#avra#Handle(bufnr(''), [
+ \ "main.asm(3) : Error : Unknown device: atmega3228p",
+ \ "main.asm(12) : Error : Unknown directive: .EQ"
+ \ ])
diff --git a/test/linter/test_avra_avra.vader b/test/linter/test_avra_avra.vader
new file mode 100644
index 00000000..04722d68
--- /dev/null
+++ b/test/linter/test_avra_avra.vader
@@ -0,0 +1,29 @@
+Before:
+ call ale#assert#SetUpLinterTest('avra', 'avra')
+
+ let b:command_tail = ' %t -o ' . g:ale#util#nul_file
+ let b:command_tail_opt = ' %t --max_errors 20 -o ' . g:ale#util#nul_file
+
+After:
+ unlet! b:command_tail
+ unlet! b:command_tail_opt
+
+ call ale#assert#TearDownLinterTest()
+
+Execute(The executable should be configurable):
+ AssertLinter 'avra', ale#Escape('avra') . b:command_tail,
+
+ let b:ale_avra_avra_executable = '~/avra'
+
+ AssertLinter '~/avra', ale#Escape('~/avra') . b:command_tail
+
+Execute(The options should be configurable):
+ let b:ale_avra_avra_options = '--max_errors 20'
+
+ AssertLinter 'avra', ale#Escape('avra')
+ \ . ' %t --max_errors 20 -o ' . g:ale#util#nul_file
+
+Execute(The options should be used in command):
+ let b:ale_avra_avra_options = '--max_errors 20'
+
+ AssertLinter 'avra', ale#Escape('avra') . b:command_tail_opt