summaryrefslogtreecommitdiff
path: root/test/command_callback/test_javac_command_callback.vader
diff options
context:
space:
mode:
authorw0rp <devw0rp@gmail.com>2019-04-07 14:58:06 +0100
committerw0rp <devw0rp@gmail.com>2019-04-07 14:58:06 +0100
commit3bebcb5d48a7150f5a318952ee309acb67fb376d (patch)
tree97edd84badca566894fd4c4f10c2a786df2fe079 /test/command_callback/test_javac_command_callback.vader
parentcdf89f8269aec31d0dfddf3a2769027d72d38155 (diff)
downloadale-3bebcb5d48a7150f5a318952ee309acb67fb376d.zip
#2132 - Replace command_chain and chain_with with ale#command#Run
Diffstat (limited to 'test/command_callback/test_javac_command_callback.vader')
-rw-r--r--test/command_callback/test_javac_command_callback.vader42
1 files changed, 25 insertions, 17 deletions
diff --git a/test/command_callback/test_javac_command_callback.vader b/test/command_callback/test_javac_command_callback.vader
index a7a928e4..42c64e54 100644
--- a/test/command_callback/test_javac_command_callback.vader
+++ b/test/command_callback/test_javac_command_callback.vader
@@ -48,30 +48,30 @@ Execute(The executable should be configurable):
\ . ' -d ' . ale#Escape('TEMP_DIR') . ' %t'
Execute(The javac callback should include discovered classpaths):
- WithChainResults [
+ let b:command = ale_linters#java#javac#GetCommand(bufnr(''), [
\ '[DEBUG] Ignore this.',
\ '[INFO] Something we should ignore.',
\ '/foo/bar.jar',
\ '/xyz/abc.jar',
- \]
+ \], {})
- AssertLinter 'javac',
+ AssertEqual
\ g:prefix
\ . ' -cp '
\ . ale#Escape(join(['/foo/bar.jar', '/xyz/abc.jar'], g:cp_sep))
- \ . ' -d ' . ale#Escape('TEMP_DIR') . ' %t'
+ \ . ' -d ' . ale#Escape('TEMP_DIR') . ' %t',
+ \ substitute(b:command, '%e', '\=ale#Escape(''javac'')', 'g')
Execute(The javac callback should combine discovered classpaths and manual ones):
let g:ale_java_javac_classpath = 'configured.jar'
-
- WithChainResults [
+ let b:command = ale_linters#java#javac#GetCommand(bufnr(''), [
\ '[DEBUG] Ignore this.',
\ '[INFO] Something we should ignore.',
\ '/foo/bar.jar',
\ '/xyz/abc.jar',
- \]
+ \], {})
- AssertLinter 'javac',
+ AssertEqual
\ g:prefix
\ . ' -cp '
\ . ale#Escape(join(
@@ -82,11 +82,18 @@ Execute(The javac callback should combine discovered classpaths and manual ones)
\ ],
\ g:cp_sep
\ ))
- \ . ' -d ' . ale#Escape('TEMP_DIR') . ' %t'
+ \ . ' -d ' . ale#Escape('TEMP_DIR') . ' %t',
+ \ substitute(b:command, '%e', '\=ale#Escape(''javac'')', 'g')
let g:ale_java_javac_classpath = 'configured.jar' . g:cp_sep . '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',
+ \], {})
- AssertLinter 'javac',
+ AssertEqual
\ g:prefix
\ . ' -cp '
\ . ale#Escape(join(
@@ -98,7 +105,8 @@ Execute(The javac callback should combine discovered classpaths and manual ones)
\ ],
\ g:cp_sep
\ ))
- \ . ' -d ' . ale#Escape('TEMP_DIR') . ' %t'
+ \ . ' -d ' . ale#Escape('TEMP_DIR') . ' %t',
+ \ substitute(b:command, '%e', '\=ale#Escape(''javac'')', 'g')
Execute(The javac callback should detect source directories):
call ale#engine#Cleanup(bufnr(''))
@@ -117,25 +125,25 @@ Execute(The javac callback should combine detected source directories and classp
call ale#test#SetFilename('java_paths/src/main/java/com/something/dummy.java')
call ale#engine#InitBufferInfo(bufnr(''))
- WithChainResults [
+ let b:command = ale_linters#java#javac#GetCommand(bufnr(''), [
\ '[DEBUG] Ignore this.',
\ '[INFO] Something we should ignore.',
\ '/foo/bar.jar',
\ '/xyz/abc.jar',
- \]
- AssertLinter 'javac',
+ \], {})
+
+ AssertEqual
\ ale#path#CdString(expand('%:p:h')) . 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/')
\ )
- \ . ' -d ' . ale#Escape('TEMP_DIR') . ' %t'
+ \ . ' -d ' . ale#Escape('TEMP_DIR') . ' %t',
+ \ substitute(b:command, '%e', '\=ale#Escape(''javac'')', 'g')
Execute(The javac callback should use g:ale_java_javac_options correctly):
let g:ale_java_javac_options = '--anything --else'
- let b:command = ale_linters#java#javac#GetCommand(bufnr(''), [])
-
AssertLinter 'javac',
\ g:prefix . ' -d ' . ale#Escape('TEMP_DIR') . ' --anything --else %t'