summaryrefslogtreecommitdiff
path: root/test/command_callback/test_thrift_command_callback.vader
diff options
context:
space:
mode:
authorw0rp <devw0rp@gmail.com>2017-10-05 22:31:00 +0100
committerw0rp <devw0rp@gmail.com>2017-10-05 22:31:09 +0100
commit47577564a2294668d7997b261e17fd97f0dd1fe6 (patch)
tree58ae1e9bbe104a528a888e83e7f8d0e9e5155b9f /test/command_callback/test_thrift_command_callback.vader
parent25045641fbe92d175f2cd322497c9796d612782a (diff)
downloadale-47577564a2294668d7997b261e17fd97f0dd1fe6.zip
Get more command callback tests to pass on Windows
Diffstat (limited to 'test/command_callback/test_thrift_command_callback.vader')
-rw-r--r--test/command_callback/test_thrift_command_callback.vader51
1 files changed, 37 insertions, 14 deletions
diff --git a/test/command_callback/test_thrift_command_callback.vader b/test/command_callback/test_thrift_command_callback.vader
index 43487f42..67008919 100644
--- a/test/command_callback/test_thrift_command_callback.vader
+++ b/test/command_callback/test_thrift_command_callback.vader
@@ -11,9 +11,17 @@ Before:
function! GetCommand(buffer) abort
call ale#engine#InitBufferInfo(a:buffer)
- let l:result = ale_linters#thrift#thrift#GetCommand(a:buffer)
+ let l:command = ale_linters#thrift#thrift#GetCommand(a:buffer)
call ale#engine#Cleanup(a:buffer)
- return l:result
+
+ let l:split_command = split(l:command)
+ let l:index = index(l:split_command, '-out')
+
+ if l:index >= 0
+ let l:split_command[l:index + 1] = 'TEMP'
+ endif
+
+ return join(l:split_command)
endfunction
runtime ale_linters/thrift/thrift.vim
@@ -34,28 +42,43 @@ Execute(The executable should be configurable):
AssertEqual 'foobar', ale_linters#thrift#thrift#GetExecutable(bufnr(''))
Execute(The executable should be used in the command):
- Assert GetCommand(bufnr('%')) =~# "^'thrift'"
+ AssertEqual
+ \ ale#Escape('thrift') . ' --gen cpp -strict -out TEMP %t',
+ \ GetCommand(bufnr('%'))
let b:ale_thrift_thrift_executable = 'foobar'
- Assert GetCommand(bufnr('%')) =~# "^'foobar'"
+ AssertEqual
+ \ ale#Escape('foobar') . ' --gen cpp -strict -out TEMP %t',
+ \ GetCommand(bufnr('%'))
Execute(The list of generators should be configurable):
- Assert GetCommand(bufnr('%')) =~# '--gen cpp'
-
let b:ale_thrift_thrift_generators = ['java', 'py:dynamic']
- Assert GetCommand(bufnr('%')) =~# '--gen java --gen py:dynamic'
+
+ AssertEqual
+ \ ale#Escape('thrift') . ' --gen java --gen py:dynamic -strict -out TEMP %t',
+ \ GetCommand(bufnr('%'))
let b:ale_thrift_thrift_generators = []
- Assert GetCommand(bufnr('%')) =~# '--gen cpp'
-Execute(The list of include paths should be configurable):
- Assert GetCommand(bufnr('%')) !~# '-I'
+ AssertEqual
+ \ ale#Escape('thrift') . ' --gen cpp -strict -out TEMP %t',
+ \ GetCommand(bufnr('%'))
+Execute(The list of include paths should be configurable):
let b:ale_thrift_thrift_includes = ['included/path']
- Assert GetCommand(bufnr('%')) =~# '-I included/path'
-Execute(The string of compiler options should be configurable):
- Assert GetCommand(bufnr('%')) =~# '-strict'
+ AssertEqual
+ \ ale#Escape('thrift')
+ \ . ' --gen cpp'
+ \ . ' -I included/path'
+ \ . ' -strict -out TEMP %t',
+ \ GetCommand(bufnr('%'))
+Execute(The string of compiler options should be configurable):
let b:ale_thrift_thrift_options = '-strict --allow-64bit-consts'
- Assert GetCommand(bufnr('%')) =~# '-strict --allow-64bit-consts'
+
+ AssertEqual
+ \ ale#Escape('thrift')
+ \ . ' --gen cpp -strict --allow-64bit-consts'
+ \ . ' -out TEMP %t',
+ \ GetCommand(bufnr('%'))