mirror of
https://github.com/dense-analysis/ale.git
synced 2026-01-09 21:12:31 +08:00
Add support for Dune (#4263)
* Add support for dune * Add test * Undo reformatting of Markdown file * Refer to ale-ocaml-dune from ale.txt
This commit is contained in:
36
test/fixers/test_dune_fixer_callback.vader
Normal file
36
test/fixers/test_dune_fixer_callback.vader
Normal file
@@ -0,0 +1,36 @@
|
||||
Before:
|
||||
Save g:ale_ocaml_dune_executable
|
||||
Save g:ale_ocaml_dune_options
|
||||
|
||||
" Use an invalid global executable, so we don't match it.
|
||||
let g:ale_ocaml_dune_executable = 'xxxinvalid'
|
||||
let g:ale_ocaml_dune_options = ''
|
||||
|
||||
call ale#test#SetDirectory('/testplugin/test/fixers')
|
||||
|
||||
After:
|
||||
Restore
|
||||
|
||||
call ale#test#RestoreDirectory()
|
||||
|
||||
Execute(The dune callback should return the correct default values):
|
||||
call ale#test#SetFilename('../test-files/ocaml/testfile.re')
|
||||
|
||||
AssertEqual
|
||||
\ {
|
||||
\ 'command': ale#Escape('xxxinvalid')
|
||||
\ . ' format',
|
||||
\ },
|
||||
\ ale#fixers#dune#Fix(bufnr(''))
|
||||
|
||||
Execute(The dune callback should include custom dune options):
|
||||
let g:ale_ocaml_dune_options = "--random-option"
|
||||
call ale#test#SetFilename('../test-files/ocaml/testfile.re')
|
||||
|
||||
AssertEqual
|
||||
\ {
|
||||
\ 'command': ale#Escape('xxxinvalid')
|
||||
\ . ' format'
|
||||
\ . ' ' . g:ale_ocaml_dune_options,
|
||||
\ },
|
||||
\ ale#fixers#dune#Fix(bufnr(''))
|
||||
Reference in New Issue
Block a user