diff options
author | NiBo <nibocn@gmail.com> | 2020-05-19 10:43:16 +0800 |
---|---|---|
committer | NiBo <nibocn@gmail.com> | 2020-05-19 10:43:16 +0800 |
commit | e61e1147b0cc33039c96f9518e22363d3d63d5a9 (patch) | |
tree | d0d8ca4d1957f60fc91891e8cf582336ce0b60cb /test/command_callback/test_javac_command_callback.vader | |
parent | ff6bfc3d374706ab80d3dc40a4d3a15baffa8ad2 (diff) | |
download | ale-e61e1147b0cc33039c96f9518e22363d3d63d5a9.zip |
refactor(javac): ale_java_javac_classpath variable supports String and List types
Diffstat (limited to 'test/command_callback/test_javac_command_callback.vader')
-rw-r--r-- | test/command_callback/test_javac_command_callback.vader | 55 |
1 files changed, 54 insertions, 1 deletions
diff --git a/test/command_callback/test_javac_command_callback.vader b/test/command_callback/test_javac_command_callback.vader index 7e612ae2..d2eebf7a 100644 --- a/test/command_callback/test_javac_command_callback.vader +++ b/test/command_callback/test_javac_command_callback.vader @@ -31,7 +31,7 @@ After: Execute(The javac callback should return the correct default value): AssertLinter 'javac', g:prefix . ' -d ' . ale#Escape('TEMP_DIR') . ' %t' -Execute(The javac callback should use g:ale_java_javac_classpath correctly): +Execute(The javac callback should use string type g:ale_java_javac_classpath correctly): let g:ale_java_javac_classpath = 'foo.jar' AssertLinter 'javac', @@ -39,6 +39,14 @@ Execute(The javac callback should use g:ale_java_javac_classpath correctly): \ . ' -cp ' . ale#Escape('foo.jar') \ . ' -d ' . ale#Escape('TEMP_DIR') . ' %t' +Execute(The javac callback should use list type g:ale_java_javac_classpath correctly): + let g:ale_java_javac_classpath = ['foo.jar'] + + AssertLinter 'javac', + \ g:prefix + \ . ' -cp ' . ale#Escape('foo.jar') + \ . ' -d ' . ale#Escape('TEMP_DIR') . ' %t' + Execute(The executable should be configurable): let g:ale_java_javac_executable = 'foobar' @@ -108,6 +116,51 @@ Execute(The javac callback should combine discovered classpaths and manual ones) \ . ' -d ' . ale#Escape('TEMP_DIR') . ' %t', \ substitute(b:command, '%e', '\=ale#Escape(''javac'')', 'g') + let g:ale_java_javac_classpath = ['configured.jar'] + let b:command = ale_linters#java#javac#GetCommand(bufnr(''), [ + \ '[DEBUG] Ignore this.', + \ '[INFO] Something we should ignore.', + \ '/foo/bar.jar', + \ '/xyz/abc.jar', + \], {}) + + AssertEqual + \ g:prefix + \ . ' -cp ' + \ . ale#Escape(join( + \ [ + \ '/foo/bar.jar', + \ '/xyz/abc.jar', + \ 'configured.jar', + \ ], + \ g:cp_sep + \ )) + \ . ' -d ' . ale#Escape('TEMP_DIR') . ' %t', + \ substitute(b:command, '%e', '\=ale#Escape(''javac'')', 'g') + + let g:ale_java_javac_classpath = ['configured.jar', 'configured2.jar'] + let b:command = ale_linters#java#javac#GetCommand(bufnr(''), [ + \ '[DEBUG] Ignore this.', + \ '[INFO] Something we should ignore.', + \ '/foo/bar.jar', + \ '/xyz/abc.jar', + \], {}) + + AssertEqual + \ g:prefix + \ . ' -cp ' + \ . ale#Escape(join( + \ [ + \ '/foo/bar.jar', + \ '/xyz/abc.jar', + \ 'configured.jar', + \ 'configured2.jar', + \ ], + \ g:cp_sep + \ )) + \ . ' -d ' . ale#Escape('TEMP_DIR') . ' %t', + \ substitute(b:command, '%e', '\=ale#Escape(''javac'')', 'g') + Execute(The javac callback should use string type g:ale_java_javac_sourcepath correctly): let g:ale_java_javac_sourcepath = 'java_paths/build/gen/main' |