ale/test/fixers/test_dune_fixer_callback.vader
Albert Peschar 854d606333
Add support for Dune (#4263)
* Add support for dune

* Add test

* Undo reformatting of Markdown file

* Refer to ale-ocaml-dune from ale.txt
2022-07-26 17:55:22 +09:00

37 lines
936 B
Plaintext

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(''))