summaryrefslogtreecommitdiff
path: root/test/command_callback
diff options
context:
space:
mode:
authorw0rp <devw0rp@gmail.com>2017-08-19 15:48:29 +0100
committerw0rp <devw0rp@gmail.com>2017-08-19 15:48:29 +0100
commit20e64fbae092e7307c4f01d82fa0e0082c3bb1cb (patch)
tree386644e3d48afbd9b8af8e8de4c100cb93df02e6 /test/command_callback
parentf8de08faf0c23ac4b76e610f685dcf6c3dfdf180 (diff)
downloadale-20e64fbae092e7307c4f01d82fa0e0082c3bb1cb.zip
#860 Only enable the new option for setting the original filename for SyntaxErl if an option is on in ALE
Diffstat (limited to 'test/command_callback')
-rw-r--r--test/command_callback/test_erlang_syntaxerl_command_callback.vader27
1 files changed, 20 insertions, 7 deletions
diff --git a/test/command_callback/test_erlang_syntaxerl_command_callback.vader b/test/command_callback/test_erlang_syntaxerl_command_callback.vader
index 800aaf3f..130becf6 100644
--- a/test/command_callback/test_erlang_syntaxerl_command_callback.vader
+++ b/test/command_callback/test_erlang_syntaxerl_command_callback.vader
@@ -1,13 +1,20 @@
Before:
Save g:ale_erlang_syntaxerl_executable
- unlet! g:ale_erlang_syntaxerl_executable b: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()
- Restore g:ale_erlang_syntaxerl_executable
-Execute (Get SyntaxErl executable):
+
+Execute (The SyntaxErl executable should be correct):
AssertEqual 'syntaxerl', ale_linters#erlang#syntaxerl#GetExecutable(bufnr(''))
let g:ale_erlang_syntaxerl_executable = '/some/other/syntaxerl'
@@ -16,11 +23,17 @@ Execute (Get SyntaxErl executable):
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 -b %s %t', ale_linters#erlang#syntaxerl#GetCommand(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):
let g:ale_erlang_syntaxerl_executable = '/some/other/syntaxerl'
- AssertEqual '/some/other/syntaxerl -b %s %t', ale_linters#erlang#syntaxerl#GetCommand(bufnr(''))
+ AssertEqual '/some/other/syntaxerl %t', ale_linters#erlang#syntaxerl#GetCommand(bufnr(''))
let b:ale_erlang_syntaxerl_executable = '/yet/another/syntaxerl'
- AssertEqual '/yet/another/syntaxerl -b %s %t', ale_linters#erlang#syntaxerl#GetCommand(bufnr(''))
+ AssertEqual '/yet/another/syntaxerl %t', ale_linters#erlang#syntaxerl#GetCommand(bufnr(''))
+
+Execute (The basename option should be set when the option is on):
+ let b:ale_erlang_syntaxerl_use_basename = 1
+
+ AssertEqual 'syntaxerl -b %s %t', ale_linters#erlang#syntaxerl#GetCommand(bufnr(''))