From 261c29c3d09607a7a4fb38a62603950e71b7635c Mon Sep 17 00:00:00 2001 From: Horacio Sanson Date: Sun, 26 Aug 2018 22:11:36 +0900 Subject: [PATCH] Add vader test and fix command callback. --- ale_linters/java/javalsp.vim | 12 +++--------- .../test_javalsp_command_callback.vader | 10 ++++++++++ 2 files changed, 13 insertions(+), 9 deletions(-) create mode 100644 test/command_callback/test_javalsp_command_callback.vader diff --git a/ale_linters/java/javalsp.vim b/ale_linters/java/javalsp.vim index fa1fe4cb..f335e83c 100644 --- a/ale_linters/java/javalsp.vim +++ b/ale_linters/java/javalsp.vim @@ -4,18 +4,12 @@ call ale#Set('java_javalsp_jar', 'javacs.jar') function! ale_linters#java#javalsp#Executable(buffer) abort - let l:jar = ale#VarFunc('java_javalsp_jar')(a:buffer) - - if filereadable(l:jar) - return 'java' - endif - - return '' + return 'java' endfunction function! ale_linters#java#javalsp#Command(buffer) abort - let l:jar = ale#VarFunc('java_javalsp_jar')(a:buffer) - return 'exec java -cp ' . l:jar . ' -Xverify:none org.javacs.Main' + let l:jar = ale#Var(a:buffer, 'java_javalsp_jar') + return ale#Escape('java -cp ' . l:jar . ' -Xverify:none org.javacs.Main') endfunction call ale#linter#Define('java', { diff --git a/test/command_callback/test_javalsp_command_callback.vader b/test/command_callback/test_javalsp_command_callback.vader new file mode 100644 index 00000000..1fbfddfb --- /dev/null +++ b/test/command_callback/test_javalsp_command_callback.vader @@ -0,0 +1,10 @@ + +Before: + call ale#assert#SetUpLinterTest('java', 'javalsp') + +After: + call ale#assert#TearDownLinterTest() + +Execute(The javalsp callback should return the correct default value): + AssertLinter 'java', ale#Escape('java -cp javacs.jar -Xverify:none org.javacs.Main') +