summaryrefslogtreecommitdiff
path: root/test/command_callback
diff options
context:
space:
mode:
authorDmitri Vereshchagin <dmitri.vereshchagin@gmail.com>2017-08-19 20:54:23 +0300
committerw0rp <w0rp@users.noreply.github.com>2017-08-19 18:54:23 +0100
commitb2d3764a18d410820b3623067067cd10f5f7f076 (patch)
tree338a8e975b432b98cf7a4f93ad5a416c07cd99e9 /test/command_callback
parent20e64fbae092e7307c4f01d82fa0e0082c3bb1cb (diff)
downloadale-b2d3764a18d410820b3623067067cd10f5f7f076.zip
Syntaxerl linter feature check (#861)
* Add feature check for SyntaxErl linter * Escape SyntaxErl executable path in commands
Diffstat (limited to 'test/command_callback')
-rw-r--r--test/command_callback/test_erlang_syntaxerl_command_callback.vader41
1 files changed, 30 insertions, 11 deletions
diff --git a/test/command_callback/test_erlang_syntaxerl_command_callback.vader b/test/command_callback/test_erlang_syntaxerl_command_callback.vader
index 130becf6..1df2be39 100644
--- a/test/command_callback/test_erlang_syntaxerl_command_callback.vader
+++ b/test/command_callback/test_erlang_syntaxerl_command_callback.vader
@@ -1,20 +1,19 @@
Before:
Save g:ale_erlang_syntaxerl_executable
- Save g:ale_erlang_syntaxerl_use_basename
unlet! g:ale_erlang_syntaxerl_executable
unlet! b:ale_erlang_syntaxerl_executable
- unlet! b:ale_erlang_syntaxerl_use_basename
runtime ale_linters/erlang/syntaxerl.vim
+
After:
Restore
call ale#linter#Reset()
-Execute (The SyntaxErl executable should be correct):
+Execute (The executable should be correct):
AssertEqual 'syntaxerl', ale_linters#erlang#syntaxerl#GetExecutable(bufnr(''))
let g:ale_erlang_syntaxerl_executable = '/some/other/syntaxerl'
@@ -23,17 +22,37 @@ Execute (The SyntaxErl executable should be correct):
let b:ale_erlang_syntaxerl_executable = '/yet/another/syntaxerl'
AssertEqual '/yet/another/syntaxerl', ale_linters#erlang#syntaxerl#GetExecutable(bufnr(''))
-Execute (The default SyntaxErl command should be correct):
- AssertEqual 'syntaxerl %t', ale_linters#erlang#syntaxerl#GetCommand(bufnr(''))
-Execute (The executable name should be used in the command):
+Execute (The executable should be presented in the feature check command):
let g:ale_erlang_syntaxerl_executable = '/some/other/syntaxerl'
- AssertEqual '/some/other/syntaxerl %t', ale_linters#erlang#syntaxerl#GetCommand(bufnr(''))
+ AssertEqual "'/some/other/syntaxerl' -h", ale_linters#erlang#syntaxerl#FeatureCheck(bufnr(''))
let b:ale_erlang_syntaxerl_executable = '/yet/another/syntaxerl'
- AssertEqual '/yet/another/syntaxerl %t', ale_linters#erlang#syntaxerl#GetCommand(bufnr(''))
+ AssertEqual "'/yet/another/syntaxerl' -h", ale_linters#erlang#syntaxerl#FeatureCheck(bufnr(''))
+
-Execute (The basename option should be set when the option is on):
- let b:ale_erlang_syntaxerl_use_basename = 1
+Execute (The executable should be presented in the command):
+ let g:ale_erlang_syntaxerl_executable = '/some/other/syntaxerl'
+ AssertEqual "'/some/other/syntaxerl' %t", ale_linters#erlang#syntaxerl#GetCommand(bufnr(''), [])
- AssertEqual 'syntaxerl -b %s %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(''), [])
+
+
+Execute (The -b option should be used when available):
+ AssertEqual "'syntaxerl' %t", ale_linters#erlang#syntaxerl#GetCommand(bufnr(''), [
+ \ 'Syntax checker for Erlang (0.14.0)',
+ \ 'Usage: syntaxerl [-d | --debug] <FILENAME>',
+ \ ' syntaxerl <-h | --help>',
+ \ ' -d, --debug Enable debug output',
+ \ ' -h, --help Show this message',
+ \ ])
+
+ AssertEqual "'syntaxerl' -b %s %t", ale_linters#erlang#syntaxerl#GetCommand(bufnr(''), [
+ \ 'Syntax checker for Erlang (0.14.0)',
+ \ 'Usage: syntaxerl [-b | --base <FILENAME>] [-d | --debug] <FILENAME>',
+ \ ' syntaxerl <-h | --help>',
+ \ ' -b, --base Set original filename',
+ \ ' -d, --debug Enable debug output',
+ \ ' -h, --help Show this message',
+ \ ])