diff options
author | jD91mZM2 <me@krake.one> | 2021-02-02 13:01:03 +0100 |
---|---|---|
committer | jD91mZM2 <me@krake.one> | 2021-02-02 13:15:46 +0100 |
commit | 98caa19cc76ee1d98121b3dbe9158374cf00f2d7 (patch) | |
tree | 6a19dd8637ce78001a4c5bc74a0d1b95fed97f49 | |
parent | 4894c760c25e9f436a071ceb80a538fb0b23b306 (diff) | |
download | ale-98caa19cc76ee1d98121b3dbe9158374cf00f2d7.zip |
Add command callback test
-rw-r--r-- | ale_linters/json/jq.vim | 2 | ||||
-rw-r--r-- | test/command_callback/test_jq_command_callback.vader | 8 | ||||
-rw-r--r-- | test/test_jq_linter.vader | 3 |
3 files changed, 12 insertions, 1 deletions
diff --git a/ale_linters/json/jq.vim b/ale_linters/json/jq.vim index 4cce0e98..777b65c6 100644 --- a/ale_linters/json/jq.vim +++ b/ale_linters/json/jq.vim @@ -5,7 +5,7 @@ call ale#Set('json_jq_executable', 'jq') function! ale_linters#json#jq#GetCommand(buffer) abort let l:executable = ale#Var(a:buffer, 'json_jq_executable') - return ale#Var(a:buffer, 'json_jq_executable') + return ale#Escape(l:executable) endfunction function! ale_linters#json#jq#Handle(buffer, lines) abort diff --git a/test/command_callback/test_jq_command_callback.vader b/test/command_callback/test_jq_command_callback.vader new file mode 100644 index 00000000..20c3db5b --- /dev/null +++ b/test/command_callback/test_jq_command_callback.vader @@ -0,0 +1,8 @@ +Before: + call ale#assert#SetUpLinterTest('json', 'jq') + +After: + call ale#assert#TearDownLinterTest() + +Execute(The default command should be correct): + AssertLinter 'jq', ale#Escape('jq') diff --git a/test/test_jq_linter.vader b/test/test_jq_linter.vader index e702f5a3..cbe23b96 100644 --- a/test/test_jq_linter.vader +++ b/test/test_jq_linter.vader @@ -1,6 +1,9 @@ Before: runtime ale_linters/json/jq.vim +After: + call ale#linter#Reset() + Execute (Should parse error correctly): AssertEqual \ [ |