summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorDmitri Vereshchagin <dmitri.vereshchagin@gmail.com>2017-08-19 17:10:03 +0300
committerDmitri Vereshchagin <dmitri.vereshchagin@gmail.com>2017-08-19 17:18:48 +0300
commite9e1bec772dfc7d26a5d8bf7d3ad2d50e6fed3d5 (patch)
tree4dc80401211549da5dcf7fd4b84381a3ec8993d8 /test
parentfb0c931b2ddd0441c04a3e1c9d5d6def87e8858e (diff)
downloadale-e9e1bec772dfc7d26a5d8bf7d3ad2d50e6fed3d5.zip
Update SyntaxErl linter tests
Diffstat (limited to 'test')
-rw-r--r--test/command_callback/test_erlang_syntaxerl_command_callback.vader26
-rw-r--r--test/handler/test_syntaxerl_handler.vader4
2 files changed, 28 insertions, 2 deletions
diff --git a/test/command_callback/test_erlang_syntaxerl_command_callback.vader b/test/command_callback/test_erlang_syntaxerl_command_callback.vader
new file mode 100644
index 00000000..821444ad
--- /dev/null
+++ b/test/command_callback/test_erlang_syntaxerl_command_callback.vader
@@ -0,0 +1,26 @@
+Before:
+ Save g:ale_erlang_syntaxerl_executable
+ unlet! g:ale_erlang_syntaxerl_executable b:ale_erlang_syntaxerl_executable
+ runtime ale_linters/erlang/syntaxerl.vim
+
+After:
+ call ale#linter#Reset()
+ Restore g:ale_erlang_syntaxerl_executable
+
+Execute (Get SyntaxErl executable):
+ AssertEqual 'syntaxerl', ale_linters#erlang#syntaxerl#GetExecutable(bufnr(''))
+
+ let g:ale_erlang_syntaxerl_executable = '/some/other/syntaxerl'
+ AssertEqual '/some/other/syntaxerl', ale_linters#erlang#syntaxerl#GetExecutable(bufnr(''))
+
+ let b:ale_erlang_syntaxerl_executable = '/yet/another/syntaxerl'
+ AssertEqual '/yet/another/syntaxerl', ale_linters#erlang#syntaxerl#GetExecutable(bufnr(''))
+
+Execute (Get SyntaxErl command line):
+ AssertEqual 'syntaxerl %t', ale_linters#erlang#syntaxerl#GetCommand(bufnr(''))
+
+ let g:ale_erlang_syntaxerl_executable = '/some/other/syntaxerl'
+ AssertEqual '/some/other/syntaxerl %t', ale_linters#erlang#syntaxerl#GetCommand(bufnr(''))
+
+ let b:ale_erlang_syntaxerl_executable = '/yet/another/syntaxerl'
+ AssertEqual '/yet/another/syntaxerl %t', ale_linters#erlang#syntaxerl#GetCommand(bufnr(''))
diff --git a/test/handler/test_syntaxerl_handler.vader b/test/handler/test_syntaxerl_handler.vader
index 1308ec84..95f2bfef 100644
--- a/test/handler/test_syntaxerl_handler.vader
+++ b/test/handler/test_syntaxerl_handler.vader
@@ -4,7 +4,7 @@ Before:
After:
call ale#linter#Reset()
-Execute:
+Execute (Handle SyntaxErl output):
AssertEqual
\ [
\ {
@@ -18,7 +18,7 @@ Execute:
\ 'type': 'W',
\ },
\ ],
- \ ale_linters#erlang#syntaxerl#Handle(42, [
+ \ ale_linters#erlang#syntaxerl#Handle(bufnr(''), [
\ "/tmp/v2wDixk/1/module.erl:42: syntax error before: ','",
\ '/tmp/v2wDixk/2/module.erl:42: warning: function foo/0 is unused',
\ ])