#3633 - Put all dummy test files in test/test-files

This commit is contained in:
w0rp
2021-03-20 22:11:22 +00:00
parent 3838ae118d
commit b1d833417b
581 changed files with 1027 additions and 1123 deletions

View File

@@ -1,34 +1,16 @@
Before:
Save g:ale_rust_rustfmt_executable
Save g:ale_rust_rustfmt_options
" Use an invalid global executable, so we don't match it.
let g:ale_rust_rustfmt_executable = 'xxxinvalid'
let g:ale_rust_rustfmt_options = ''
call ale#test#SetDirectory('/testplugin/test/fixers')
call ale#assert#SetUpFixerTest('rust', 'rustfmt')
After:
Restore
call ale#test#RestoreDirectory()
call ale#assert#TearDownFixerTest()
Execute(The rustfmt callback should return the correct default values):
call ale#test#SetFilename('../rust_files/testfile.rs')
call ale#test#SetFilename('../test-files/rust/testfile.rs')
AssertEqual
\ {
\ 'command': ale#Escape('xxxinvalid'),
\ },
\ ale#fixers#rustfmt#Fix(bufnr(''))
AssertFixer {'command': ale#Escape('rustfmt')}
Execute(The rustfmt callback should include custom rustfmt options):
let g:ale_rust_rustfmt_options = "--skip-children"
call ale#test#SetFilename('../rust_files/testfile.rs')
call ale#test#SetFilename('../test-files/rust/testfile.rs')
AssertEqual
\ {
\ 'command': ale#Escape('xxxinvalid')
\ . ' ' . g:ale_rust_rustfmt_options,
\ },
\ ale#fixers#rustfmt#Fix(bufnr(''))
AssertFixer {'command': ale#Escape('rustfmt') . ' ' . g:ale_rust_rustfmt_options}