diff options
author | w0rp <devw0rp@gmail.com> | 2017-11-20 16:42:43 +0000 |
---|---|---|
committer | w0rp <devw0rp@gmail.com> | 2017-11-20 18:54:57 +0000 |
commit | c9e203e6204314b55aed76c49f57aaf8ab826c90 (patch) | |
tree | 1b42e5306429ef6015558f1f626a66cf0e2cbee2 /test/command_callback/test_javac_command_callback.vader | |
parent | f20e5a4cf0e56c3c89ef7be4730924be377e5f61 (diff) | |
download | ale-c9e203e6204314b55aed76c49f57aaf8ab826c90.zip |
Fix #859 Include test and jaxb Java source paths when available
Diffstat (limited to 'test/command_callback/test_javac_command_callback.vader')
-rw-r--r-- | test/command_callback/test_javac_command_callback.vader | 32 |
1 files changed, 31 insertions, 1 deletions
diff --git a/test/command_callback/test_javac_command_callback.vader b/test/command_callback/test_javac_command_callback.vader index 77be1d59..fe545307 100644 --- a/test/command_callback/test_javac_command_callback.vader +++ b/test/command_callback/test_javac_command_callback.vader @@ -116,7 +116,7 @@ Execute(The javac callback should combine discovered classpaths and manual ones) Execute(The javac callback should detect source directories): call ale#engine#Cleanup(bufnr('')) - :e! java_paths/src/main/java/com/something/dummy + noautocmd e! java_paths/src/main/java/com/something/dummy call ale#engine#InitBufferInfo(bufnr('')) AssertEqual @@ -155,3 +155,33 @@ Execute(The javac callback should use g:ale_java_javac_options correctly): \ g:prefix \ . ' -d TEMP --anything --else %t', \ GetCommand([]) + +Execute(The javac callback should include src/test/java for test paths): + call ale#engine#Cleanup(bufnr('')) + " The test path is only included for test files. + " Regular Java files shouldn't import from tests. + noautocmd e! java_paths/src/test/java/com/something/dummy + call ale#engine#InitBufferInfo(bufnr('')) + + AssertEqual + \ 'cd ' . ale#Escape(expand('%:p:h')) . ' && javac -Xlint' + \ . ' -sourcepath ' . ale#Escape(join([ + \ ale#path#Winify(g:dir . '/java_paths/src/main/java/'), + \ ale#path#Winify(g:dir . '/java_paths/src/test/java/'), + \ ], g:cp_sep)) + \ . ' -d TEMP %t', + \ GetCommand([]) + +Execute(The javac callback should include src/main/jaxb when available): + call ale#engine#Cleanup(bufnr('')) + noautocmd e! java_paths_with_jaxb/src/main/java/com/something/dummy + call ale#engine#InitBufferInfo(bufnr('')) + + AssertEqual + \ 'cd ' . ale#Escape(expand('%:p:h')) . ' && javac -Xlint' + \ . ' -sourcepath ' . ale#Escape(join([ + \ ale#path#Winify(g:dir . '/java_paths_with_jaxb/src/main/java/'), + \ ale#path#Winify(g:dir . '/java_paths_with_jaxb/src/main/jaxb/'), + \ ], g:cp_sep)) + \ . ' -d TEMP %t', + \ GetCommand([]) |