2017-11-05 21:24:41 +00:00
|
|
|
Before:
|
|
|
|
Save g:ale_sh_shfmt_executable
|
|
|
|
Save g:ale_sh_shfmt_options
|
2018-09-18 06:41:33 +00:00
|
|
|
Save &l:expandtab
|
|
|
|
Save &l:shiftwidth
|
|
|
|
Save &l:tabstop
|
2017-11-05 21:24:41 +00:00
|
|
|
|
2017-11-05 21:31:41 +00:00
|
|
|
After:
|
|
|
|
Restore
|
2017-11-05 21:24:41 +00:00
|
|
|
|
2018-09-18 06:41:33 +00:00
|
|
|
Execute(The shfmt callback should return 'shfmt' as default command):
|
|
|
|
setlocal noexpandtab
|
|
|
|
Assert
|
|
|
|
\ ale#fixers#shfmt#Fix(bufnr('')).command =~# '^' . ale#Escape('shfmt'),
|
|
|
|
\ "Default command name is expected to be 'shfmt'"
|
|
|
|
|
2017-11-05 21:31:41 +00:00
|
|
|
Execute(The shfmt executable and options should be configurable):
|
|
|
|
let g:ale_sh_shfmt_executable = 'foobar'
|
2017-11-05 21:24:41 +00:00
|
|
|
let g:ale_sh_shfmt_options = '--some-option'
|
|
|
|
|
|
|
|
AssertEqual
|
|
|
|
\ {
|
2017-11-05 21:31:41 +00:00
|
|
|
\ 'command': ale#Escape('foobar')
|
2022-07-02 13:05:03 +00:00
|
|
|
\ . ' -filename=%s'
|
2017-11-05 21:24:41 +00:00
|
|
|
\ . ' --some-option',
|
|
|
|
\ },
|
|
|
|
\ ale#fixers#shfmt#Fix(bufnr(''))
|