summaryrefslogtreecommitdiff
path: root/test/command_callback/test_cs_mcsc_command_callbacks.vader
diff options
context:
space:
mode:
authorw0rp <devw0rp@gmail.com>2017-12-19 17:34:34 +0000
committerw0rp <devw0rp@gmail.com>2017-12-19 17:34:34 +0000
commit0ad254799781ba1e00b13b26dfbee5c6fed9684f (patch)
treed76c53d0bef477fc266f3b73e9a9d26405e1b317 /test/command_callback/test_cs_mcsc_command_callbacks.vader
parent647c798eb79849d67c71825faf610136a4fc1a27 (diff)
downloadale-0ad254799781ba1e00b13b26dfbee5c6fed9684f.zip
Fix mcsc paths and escaping for Windows
Diffstat (limited to 'test/command_callback/test_cs_mcsc_command_callbacks.vader')
-rw-r--r--test/command_callback/test_cs_mcsc_command_callbacks.vader32
1 files changed, 23 insertions, 9 deletions
diff --git a/test/command_callback/test_cs_mcsc_command_callbacks.vader b/test/command_callback/test_cs_mcsc_command_callbacks.vader
index 441cef53..cb52c969 100644
--- a/test/command_callback/test_cs_mcsc_command_callbacks.vader
+++ b/test/command_callback/test_cs_mcsc_command_callbacks.vader
@@ -12,6 +12,8 @@ Before:
unlet! g:ale_cs_mcsc_assembly_path
unlet! g:ale_cs_mcsc_assemblies
+ let g:prefix = ' -out:TEMP -t:module -recurse:' . ale#Escape('*.cs')
+
function! GetCommand()
let l:command = ale_linters#cs#mcsc#GetCommand(bufnr(''))
let l:command = join(split(l:command))
@@ -28,52 +30,64 @@ After:
unlet! g:ale_cs_mcsc_source
unlet! g:ale_cs_mcsc_assembly_path
unlet! g:ale_cs_mcsc_assemblies
+ unlet! g:ale_prefix
delfunction GetCommand
call ale#linter#Reset()
-Execute(Check for proper default command):
+Execute(The mcsc linter should return the correct default command):
AssertEqual
- \ 'cd ".";mcs -unsafe -out:TEMP -t:module -recurse:"*.cs"',
+ \ ale#path#BufferCdString(bufnr(''))
+ \ . 'mcs -unsafe' . g:prefix,
\ GetCommand()
Execute(The options should be be used in the command):
let g:ale_cs_mcsc_options = '-pkg:dotnet'
AssertEqual
- \ 'cd ".";mcs -unsafe ' . g:ale_cs_mcsc_options . ' -out:TEMP -t:module -recurse:"*.cs"',
+ \ ale#path#BufferCdString(bufnr(''))
+ \ . 'mcs -unsafe -pkg:dotnet' . g:prefix,
\ GetCommand()
Execute(The souce path should be be used in the command):
- let g:ale_cs_mcsc_source='../foo/bar'
+ let g:ale_cs_mcsc_source = '../foo/bar'
AssertEqual
- \ 'cd "' . g:ale_cs_mcsc_source . '";mcs -unsafe -out:TEMP -t:module -recurse:"*.cs"',
+ \ 'cd ' . ale#Escape('../foo/bar') . ' && '
+ \ . 'mcs -unsafe' . g:prefix,
\ GetCommand()
Execute(The list of search pathes for assemblies should be be used in the command if not empty):
let g:ale_cs_mcsc_assembly_path = ['/usr/lib/mono', '../foo/bar']
AssertEqual
- \ 'cd ".";mcs -unsafe -lib:"' . join(g:ale_cs_mcsc_assembly_path,'","') . '" -out:TEMP -t:module -recurse:"*.cs"',
+ \ ale#path#BufferCdString(bufnr(''))
+ \ . 'mcs -unsafe'
+ \ . ' -lib:' . ale#Escape('/usr/lib/mono') . ',' . ale#Escape('../foo/bar')
+ \ . g:prefix,
\ GetCommand()
let g:ale_cs_mcsc_assembly_path = []
AssertEqual
- \ 'cd ".";mcs -unsafe -out:TEMP -t:module -recurse:"*.cs"',
+ \ ale#path#BufferCdString(bufnr(''))
+ \ . 'mcs -unsafe' . g:prefix,
\ GetCommand()
Execute(The list of assemblies should be be used in the command if not empty):
let g:ale_cs_mcsc_assemblies = ['foo.dll', 'bar.dll']
AssertEqual
- \ 'cd ".";mcs -unsafe -r:"' . join(g:ale_cs_mcsc_assemblies,'","') . '" -out:TEMP -t:module -recurse:"*.cs"',
+ \ ale#path#BufferCdString(bufnr(''))
+ \ . 'mcs -unsafe'
+ \ . ' -r:' . ale#Escape('foo.dll') . ',' . ale#Escape('bar.dll')
+ \ . g:prefix,
\ GetCommand()
let g:ale_cs_mcsc_assemblies = []
AssertEqual
- \ 'cd ".";mcs -unsafe -out:TEMP -t:module -recurse:"*.cs"',
+ \ ale#path#BufferCdString(bufnr(''))
+ \ . 'mcs -unsafe' . g:prefix,
\ GetCommand()