diff options
author | w0rp <devw0rp@gmail.com> | 2017-11-05 15:33:31 +0000 |
---|---|---|
committer | w0rp <devw0rp@gmail.com> | 2017-11-05 15:33:31 +0000 |
commit | 34674e088d7d990d21a4cee5e289200cee5f9d6c (patch) | |
tree | b7a2625e08b20699b554a7ae160b1bdc67fede8d /test/command_callback/test_javac_command_callback.vader | |
parent | d851f399c054d487232294d9f1c3a6974215f4a8 (diff) | |
download | ale-34674e088d7d990d21a4cee5e289200cee5f9d6c.zip |
Fix #1061 - Handle the filenames returned by javac
Diffstat (limited to 'test/command_callback/test_javac_command_callback.vader')
-rw-r--r-- | test/command_callback/test_javac_command_callback.vader | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/test/command_callback/test_javac_command_callback.vader b/test/command_callback/test_javac_command_callback.vader index 8033e4f6..77be1d59 100644 --- a/test/command_callback/test_javac_command_callback.vader +++ b/test/command_callback/test_javac_command_callback.vader @@ -28,12 +28,15 @@ Before: call ale#test#SetFilename('dummy.java') + let g:prefix = 'cd ' . ale#Escape(expand('%:p:h')) . ' && javac -Xlint' + After: call ale#test#RestoreDirectory() Restore unlet! g:cp_sep + unlet! g:prefix delfunction GetCommand @@ -43,20 +46,21 @@ After: call ale#engine#Cleanup(bufnr('')) Execute(The javac callback should return the correct default value): - AssertEqual 'javac -Xlint -d TEMP %t', GetCommand([]) + AssertEqual g:prefix . ' -d TEMP %t', GetCommand([]) Execute(The javac callback should use g:ale_java_javac_classpath correctly): let g:ale_java_javac_classpath = 'foo.jar' AssertEqual - \ 'javac -Xlint' + \ g:prefix \ . ' -cp ' . ale#Escape('foo.jar') \ . ' -d TEMP %t', \ GetCommand([]) Execute(The javac callback should include discovered classpaths): AssertEqual - \ 'javac -Xlint -cp ' + \ g:prefix + \ . ' -cp ' \ . ale#Escape(join(['/foo/bar.jar', '/xyz/abc.jar'], g:cp_sep)) \ . ' -d TEMP %t', \ GetCommand([ @@ -70,7 +74,8 @@ Execute(The javac callback should combine discovered classpaths and manual ones) let g:ale_java_javac_classpath = 'configured.jar' AssertEqual - \ 'javac -Xlint -cp ' + \ g:prefix + \ . ' -cp ' \ . ale#Escape(join( \ [ \ '/foo/bar.jar', @@ -90,7 +95,8 @@ Execute(The javac callback should combine discovered classpaths and manual ones) let g:ale_java_javac_classpath = 'configured.jar' . g:cp_sep . 'configured2.jar' AssertEqual - \ 'javac -Xlint -cp ' + \ g:prefix + \ . ' -cp ' \ . ale#Escape(join( \ [ \ '/foo/bar.jar', @@ -114,7 +120,7 @@ Execute(The javac callback should detect source directories): call ale#engine#InitBufferInfo(bufnr('')) AssertEqual - \ 'javac -Xlint' + \ 'cd ' . ale#Escape(expand('%:p:h')) . ' && javac -Xlint' \ . ' -sourcepath ' . ale#Escape( \ ale#path#Winify(g:dir . '/java_paths/src/main/java/') \ ) @@ -127,7 +133,7 @@ Execute(The javac callback should combine detected source directories and classp call ale#engine#InitBufferInfo(bufnr('')) AssertEqual - \ 'javac -Xlint' + \ 'cd ' . ale#Escape(expand('%:p:h')) . ' && javac -Xlint' \ . ' -cp ' . ale#Escape(join(['/foo/bar.jar', '/xyz/abc.jar'], g:cp_sep)) \ . ' -sourcepath ' . ale#Escape( \ ale#path#Winify(g:dir . '/java_paths/src/main/java/') @@ -146,6 +152,6 @@ Execute(The javac callback should use g:ale_java_javac_options correctly): let b:command = ale_linters#java#javac#GetCommand(bufnr(''), []) AssertEqual - \ 'javac -Xlint' + \ g:prefix \ . ' -d TEMP --anything --else %t', \ GetCommand([]) |