ale/test/test_prepare_command.vader

40 lines
1.0 KiB
Plaintext

Before:
Save &shell
Save &shellcmdflag
After:
Restore
Execute(sh should be used when the shell is fish):
if !has('win32')
" Set something else, so we will replace that too.
let &shellcmdflag = '-f'
let &shell = 'fish'
AssertEqual ['/bin/sh', '-c', 'foobar'], ale#job#PrepareCommand(bufnr(''), 'foobar')
let &shell = '/usr/bin/fish'
AssertEqual ['/bin/sh', '-c', 'foobar'], ale#job#PrepareCommand(bufnr(''), 'foobar')
let &shell = '/usr/local/bin/fish'
AssertEqual ['/bin/sh', '-c', 'foobar'], ale#job#PrepareCommand(bufnr(''), 'foobar')
endif
Execute(Other shells should be used when set):
if !has('win32')
let &shell = '/bin/bash'
let &shellcmdflag = '-c'
AssertEqual ['/bin/bash', '-c', 'foobar'], ale#job#PrepareCommand(bufnr(''), 'foobar')
endif
Execute(cmd /c as a string should be used on Windows):
if has('win32')
let &shell = 'who cares'
let &shellcmdflag = 'whatever'
AssertEqual 'cmd /c foobar', ale#job#PrepareCommand(bufnr(''), 'foobar')
endif