diff options
author | w0rp <devw0rp@gmail.com> | 2021-03-01 20:11:10 +0000 |
---|---|---|
committer | w0rp <devw0rp@gmail.com> | 2021-03-01 20:11:10 +0000 |
commit | 9fe7b1fe6a23fb55e6d782293585d58193123f59 (patch) | |
tree | 0403deb70011aee7be08e586b10b5828cf69499e /test/command_callback/test_javac_command_callback.vader | |
parent | 48fab99a0ab793e1b9607795c21659f12bd6947f (diff) | |
download | ale-9fe7b1fe6a23fb55e6d782293585d58193123f59.zip |
Close #2281 - Separate cwd commands from commands
Working directories are now set seperately from the commands so they
can later be swapped out when running linters over projects is
supported, and also better support filename mapping for running linters
on other machines in future.
Diffstat (limited to 'test/command_callback/test_javac_command_callback.vader')
-rw-r--r-- | test/command_callback/test_javac_command_callback.vader | 34 |
1 files changed, 12 insertions, 22 deletions
diff --git a/test/command_callback/test_javac_command_callback.vader b/test/command_callback/test_javac_command_callback.vader index ac898e5f..29ed09b8 100644 --- a/test/command_callback/test_javac_command_callback.vader +++ b/test/command_callback/test_javac_command_callback.vader @@ -3,8 +3,7 @@ Before: call ale#test#SetFilename('dummy.java') let g:cp_sep = has('unix') ? ':' : ';' - let g:prefix = ale#path#BufferCdString(bufnr('')) - \ . ale#Escape('javac') . ' -Xlint' + let g:prefix = ale#Escape('javac') . ' -Xlint' function! GetCommand(previous_output) abort let l:command = ale_linters#java#javac#GetCommand( @@ -29,6 +28,7 @@ After: call ale#assert#TearDownLinterTest() Execute(The javac callback should return the correct default value): + AssertLinterCwd '%s:h' AssertLinter 'javac', g:prefix . ' -d ' . ale#Escape('TEMP_DIR') . ' %t' Execute(The javac callback should use string type g:ale_java_javac_classpath correctly): @@ -51,8 +51,7 @@ Execute(The executable should be configurable): let g:ale_java_javac_executable = 'foobar' AssertLinter 'foobar', - \ ale#path#BufferCdString(bufnr('')) - \ . ale#Escape('foobar') . ' -Xlint' + \ ale#Escape('foobar') . ' -Xlint' \ . ' -d ' . ale#Escape('TEMP_DIR') . ' %t' Execute(The javac callback should include discovered classpaths): @@ -197,8 +196,7 @@ Execute(The javac callback should combine discovered sourcepath and manual ones) let b:command = ale_linters#java#javac#GetCommand(bufnr(''), [], {}) AssertEqual - \ ale#path#BufferCdString(bufnr('')) - \ . ale#Escape('javac') . ' -Xlint' + \ ale#Escape('javac') . ' -Xlint' \ . ' -sourcepath ' . ale#Escape(join([ \ ale#path#Simplify(g:dir . '/java_paths/src/main/java/'), \ ale#path#Simplify(g:dir . '/java_paths/build/gen/main/'), @@ -211,8 +209,7 @@ Execute(The javac callback should combine discovered sourcepath and manual ones) let b:command = ale_linters#java#javac#GetCommand(bufnr(''), [], {}) AssertEqual - \ ale#path#BufferCdString(bufnr('')) - \ . ale#Escape('javac') . ' -Xlint' + \ ale#Escape('javac') . ' -Xlint' \ . ' -sourcepath ' . ale#Escape(join([ \ ale#path#Simplify(g:dir . '/java_paths/src/main/java/'), \ ale#path#Simplify(g:dir . '/java_paths/build/gen/main/'), @@ -225,8 +222,7 @@ Execute(The javac callback should combine discovered sourcepath and manual ones) let b:command = ale_linters#java#javac#GetCommand(bufnr(''), [], {}) AssertEqual - \ ale#path#BufferCdString(bufnr('')) - \ . ale#Escape('javac') . ' -Xlint' + \ ale#Escape('javac') . ' -Xlint' \ . ' -sourcepath ' . ale#Escape(join([ \ ale#path#Simplify(g:dir . '/java_paths/src/main/java/'), \ ale#path#Simplify(g:dir . '/java_paths/build/gen/main/') @@ -241,8 +237,7 @@ Execute(The javac callback should combine discovered sourcepath and manual ones) let b:command = ale_linters#java#javac#GetCommand(bufnr(''), [], {}) AssertEqual - \ ale#path#BufferCdString(bufnr('')) - \ . ale#Escape('javac') . ' -Xlint' + \ ale#Escape('javac') . ' -Xlint' \ . ' -sourcepath ' . ale#Escape(join([ \ ale#path#Simplify(g:dir . '/java_paths/src/main/java/'), \ ale#path#Simplify(g:dir . '/java_paths/build/gen/main/'), @@ -257,8 +252,7 @@ Execute(The javac callback should detect source directories): call ale#engine#InitBufferInfo(bufnr('')) AssertLinter 'javac', - \ ale#path#BufferCdString(bufnr('')) - \ . ale#Escape('javac') . ' -Xlint' + \ ale#Escape('javac') . ' -Xlint' \ . ' -sourcepath ' . ale#Escape( \ ale#path#Simplify(g:dir . '/java_paths/src/main/java/') \ ) @@ -277,8 +271,7 @@ Execute(The javac callback should combine detected source directories and classp \], {}) AssertEqual - \ ale#path#BufferCdString(bufnr('')) - \ . ale#Escape('javac') . ' -Xlint' + \ ale#Escape('javac') . ' -Xlint' \ . ' -cp ' . ale#Escape(join(['/foo/bar.jar', '/xyz/abc.jar'], g:cp_sep)) \ . ' -sourcepath ' . ale#Escape( \ ale#path#Simplify(g:dir . '/java_paths/src/main/java/') @@ -300,8 +293,7 @@ Execute(The javac callback should include src/test/java for test paths): call ale#engine#InitBufferInfo(bufnr('')) AssertLinter 'javac', - \ ale#path#BufferCdString(bufnr('')) - \ . ale#Escape('javac') . ' -Xlint' + \ ale#Escape('javac') . ' -Xlint' \ . ' -sourcepath ' . ale#Escape(join([ \ ale#path#Simplify(g:dir . '/java_paths/src/main/java/'), \ ale#path#Simplify(g:dir . '/java_paths/src/test/java/'), @@ -314,8 +306,7 @@ Execute(The javac callback should include src/main/jaxb when available): call ale#engine#InitBufferInfo(bufnr('')) AssertLinter 'javac', - \ ale#path#BufferCdString(bufnr('')) - \ . ale#Escape('javac') . ' -Xlint' + \ ale#Escape('javac') . ' -Xlint' \ . ' -sourcepath ' . ale#Escape(join([ \ ale#path#Simplify(g:dir . '/java_paths_with_jaxb/src/main/java/'), \ ale#path#Simplify(g:dir . '/java_paths_with_jaxb/src/main/jaxb/'), @@ -328,8 +319,7 @@ Execute(The javac callback should add -sourcepath even if src/java/main doesn't call ale#engine#InitBufferInfo(bufnr('')) AssertLinter 'javac', - \ ale#path#BufferCdString(bufnr('')) - \ . ale#Escape('javac') . ' -Xlint' + \ ale#Escape('javac') . ' -Xlint' \ . ' -sourcepath ' . ale#Escape(join([ \ ale#path#Simplify(g:dir . '/java_paths_no_main/src/test/java/'), \ ], g:cp_sep)) |