test: Find .astylerc placed with src for astyle

This commit is contained in:
jhlink 2020-07-30 09:43:41 -04:00
parent d49b06e030
commit ab6aed17ab
2 changed files with 13 additions and 0 deletions

View file

@ -81,3 +81,16 @@ Execute(The astyle callback should find nearest default option file _astylrc):
\ . ' --stdin=' . ale#Escape(targetfile)
\ },
\ ale#fixers#astyle#Fix(bufnr(''))
Execute(The astyle callback should find .astylrc in the same directory as src):
call ale#test#SetFilename('../test_cpp_project/dummy.cpp')
set filetype=cpp " The test fails without this
let targetfile = bufname(bufnr('%'))
AssertEqual
\ {
\ 'command': ale#Escape('invalidpp')
\ . ' --project=.astylerc'
\ . ' --stdin=' . ale#Escape(targetfile)
\ },
\ ale#fixers#astyle#Fix(bufnr(''))

View file