ale/test/command_callback/test_cs_mcsc_command_callbacks.vader

80 lines
2.2 KiB
Plaintext
Raw Normal View History

Before:
Save g:ale_cs_mcsc_options
Save g:ale_cs_mcsc_source
Save g:ale_cs_mcsc_assembly_path
Save g:ale_cs_mcsc_assemblies
2017-10-18 18:42:51 -04:00
Save g:ale_buffer_info
let g:ale_buffer_info = {bufnr(''): {'temporary_file_list': []}}
unlet! g:ale_cs_mcsc_options
unlet! g:ale_cs_mcsc_source
unlet! g:ale_cs_mcsc_assembly_path
unlet! g:ale_cs_mcsc_assemblies
2017-10-18 18:42:51 -04:00
function! GetCommand()
let l:command = ale_linters#cs#mcsc#GetCommand(bufnr(''))
let l:command = join(split(l:command))
return substitute(l:command, ':[^ ]\+ -t:module', ':TEMP -t:module', '')
endfunction
runtime ale_linters/cs/mcsc.vim
After:
Restore
2017-10-18 18:42:51 -04:00
unlet! b:ale_cs_mcsc_options
unlet! g:ale_cs_mcsc_source
unlet! g:ale_cs_mcsc_assembly_path
unlet! g:ale_cs_mcsc_assemblies
2017-10-18 18:42:51 -04:00
delfunction GetCommand
2017-10-18 18:42:51 -04:00
call ale#linter#Reset()
2017-10-18 18:42:51 -04:00
Execute(Check for proper default command):
AssertEqual
2017-10-18 18:42:51 -04:00
\ 'cd ".";mcs -unsafe -out:TEMP -t:module -recurse:"*.cs"',
\ GetCommand()
Execute(The options should be be used in the command):
let g:ale_cs_mcsc_options = '-pkg:dotnet'
AssertEqual
2017-10-18 18:42:51 -04:00
\ 'cd ".";mcs -unsafe ' . g:ale_cs_mcsc_options . ' -out:TEMP -t:module -recurse:"*.cs"',
\ GetCommand()
Execute(The souce path should be be used in the command):
let g:ale_cs_mcsc_source='../foo/bar'
AssertEqual
2017-10-18 18:42:51 -04:00
\ 'cd "' . g:ale_cs_mcsc_source . '";mcs -unsafe -out:TEMP -t:module -recurse:"*.cs"',
\ GetCommand()
Execute(The list of search pathes for assemblies should be be used in the command if not empty):
2017-10-18 18:42:51 -04:00
let g:ale_cs_mcsc_assembly_path = ['/usr/lib/mono', '../foo/bar']
AssertEqual
2017-10-18 18:42:51 -04:00
\ 'cd ".";mcs -unsafe -lib:"' . join(g:ale_cs_mcsc_assembly_path,'","') . '" -out:TEMP -t:module -recurse:"*.cs"',
\ GetCommand()
2017-10-18 18:42:51 -04:00
let g:ale_cs_mcsc_assembly_path = []
AssertEqual
2017-10-18 18:42:51 -04:00
\ 'cd ".";mcs -unsafe -out:TEMP -t:module -recurse:"*.cs"',
\ GetCommand()
Execute(The list of assemblies should be be used in the command if not empty):
2017-10-18 18:42:51 -04:00
let g:ale_cs_mcsc_assemblies = ['foo.dll', 'bar.dll']
AssertEqual
2017-10-18 18:42:51 -04:00
\ 'cd ".";mcs -unsafe -r:"' . join(g:ale_cs_mcsc_assemblies,'","') . '" -out:TEMP -t:module -recurse:"*.cs"',
\ GetCommand()
2017-10-18 18:42:51 -04:00
let g:ale_cs_mcsc_assemblies = []
AssertEqual
2017-10-18 18:42:51 -04:00
\ 'cd ".";mcs -unsafe -out:TEMP -t:module -recurse:"*.cs"',
\ GetCommand()