mirror of
https://github.com/dense-analysis/ale.git
synced 2025-12-06 12:44:23 +08:00
Add support for temporary filename substitution, for replacing stdin_wrapper
This commit is contained in:
33
test/test_format_temporary_file_creation.vader
Normal file
33
test/test_format_temporary_file_creation.vader
Normal file
@@ -0,0 +1,33 @@
|
||||
Before:
|
||||
let g:output = []
|
||||
|
||||
function! TestCallback(buffer, output)
|
||||
let g:output = a:output
|
||||
|
||||
return []
|
||||
endfunction
|
||||
|
||||
call ale#linter#Define('foobar', {
|
||||
\ 'name': 'testlinter',
|
||||
\ 'callback': 'TestCallback',
|
||||
\ 'executable': 'cat',
|
||||
\ 'command': 'cat %t',
|
||||
\})
|
||||
|
||||
After:
|
||||
unlet! g:output
|
||||
delfunction TestCallback
|
||||
call ale#linter#Reset()
|
||||
|
||||
Given foobar (Some imaginary filetype):
|
||||
foo
|
||||
bar
|
||||
baz
|
||||
|
||||
Execute(ALE should be able to read the %t file):
|
||||
AssertEqual 'foobar', &filetype
|
||||
|
||||
call ale#Lint()
|
||||
call ale#engine#WaitForJobs(2000)
|
||||
|
||||
AssertEqual ['foo', 'bar', 'baz'], g:output
|
||||
Reference in New Issue
Block a user