summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorSamuel Branisa <branisa.samuel@windowslive.com>2021-09-11 02:19:17 +0200
committerGitHub <noreply@github.com>2021-09-11 09:19:17 +0900
commit19437e25d05950ab83dce285b4b8ec5166e06dba (patch)
treef961d8ddc232dbd0123021b770f3aebe39b472e2 /test
parentbf29f6ea92ff993d5d96bc4e760f315e95e332a5 (diff)
downloadale-19437e25d05950ab83dce285b4b8ec5166e06dba.zip
Robot framework rflint support (#3715)
* Create rflint.vim support for robot framework by creating ale definition for rflint syntax linter * robot framework - rflint support
Diffstat (limited to 'test')
-rw-r--r--test/handler/test_rflint_handler.vader33
-rw-r--r--test/linter/test_rflint.vader20
2 files changed, 53 insertions, 0 deletions
diff --git a/test/handler/test_rflint_handler.vader b/test/handler/test_rflint_handler.vader
new file mode 100644
index 00000000..f2670141
--- /dev/null
+++ b/test/handler/test_rflint_handler.vader
@@ -0,0 +1,33 @@
+Before:
+ runtime ale_linters/robot/rflint.vim
+
+After:
+ call ale#linter#Reset()
+
+Execute(Warning and error messages should be handled correctly):
+ AssertEqual
+ \ [
+ \ {
+ \ 'bufnr': 1,
+ \ 'filename': 'test.robot',
+ \ 'type': 'W',
+ \ 'lnum': 1,
+ \ 'col': 2,
+ \ 'text': 'RequireSuiteDocumentation',
+ \ 'detail': 'No suite documentation',
+ \ },
+ \ {
+ \ 'bufnr': 1,
+ \ 'filename': 'test.robot',
+ \ 'type': 'E',
+ \ 'lnum': 3,
+ \ 'col': 4,
+ \ 'text': 'RequireTestDocumentation',
+ \ 'detail': 'No testcase documentation',
+ \ },
+ \ ],
+ \ ale_linters#robot#rflint#Handle(1, [
+ \ 'test.robot:W:1:2:RequireSuiteDocumentation:No suite documentation',
+ \ 'test.robot:E:3:4:RequireTestDocumentation:No testcase documentation'
+ \])
+
diff --git a/test/linter/test_rflint.vader b/test/linter/test_rflint.vader
new file mode 100644
index 00000000..0ee97b30
--- /dev/null
+++ b/test/linter/test_rflint.vader
@@ -0,0 +1,20 @@
+Before:
+ call ale#assert#SetUpLinterTest('robot', 'rflint')
+ let b:rflint_format = ' --format'
+ \ . ' "{filename}:{severity}:{linenumber}:{char}:{rulename}:{message}" %s'
+
+After:
+ call ale#assert#TearDownLinterTest()
+ unlet! b:rflint_format
+
+Execute(The rflint command callback should return default string):
+ AssertLinter 'rflint',
+ \ 'rflint'
+ \ . b:rflint_format
+
+Execute(The rflint executable should be configurable):
+ let g:ale_robot_rflint_executable = '~/.local/bin/rflint'
+
+ AssertLinter '~/.local/bin/rflint',
+ \ '~/.local/bin/rflint'
+ \ . b:rflint_format