mirror of
https://github.com/dense-analysis/ale.git
synced 2025-12-09 05:54:45 +08:00
test: Add astyle vader test
This commit is contained in:
23
test/fixers/test_astyle_fixer_callback.vader
Normal file
23
test/fixers/test_astyle_fixer_callback.vader
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
Before:
|
||||||
|
Save g:ale_c_astyle_executable
|
||||||
|
|
||||||
|
" Use an invalid global executable, so we don't match it.
|
||||||
|
let g:ale_c_astyle_executable = 'xxxinvalid'
|
||||||
|
|
||||||
|
call ale#test#SetDirectory('/testplugin/test/fixers')
|
||||||
|
|
||||||
|
After:
|
||||||
|
Restore
|
||||||
|
|
||||||
|
call ale#test#RestoreDirectory()
|
||||||
|
|
||||||
|
Execute(The astyle callback should return the correct default values):
|
||||||
|
call ale#test#SetFilename('../c_files/testfile.c')
|
||||||
|
|
||||||
|
AssertEqual
|
||||||
|
\ {
|
||||||
|
\ 'read_temporary_file': 1,
|
||||||
|
\ 'command': ale#Escape('xxxinvalid')
|
||||||
|
\ . ' %t',
|
||||||
|
\ },
|
||||||
|
\ ale#fixers#astyle#Fix(bufnr(''))
|
||||||
Reference in New Issue
Block a user