summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorAlbert Peschar <albert@peschar.net>2022-07-26 11:55:22 +0300
committerGitHub <noreply@github.com>2022-07-26 17:55:22 +0900
commit854d6063331c686ded959ecb17830fb8c34f2db3 (patch)
treee2c871616021f38761e5f0c9c1bac4158acdb0b0 /test
parent0ea53870b6b93eb3b20dbd8317291cfe06dc38bd (diff)
downloadale-854d6063331c686ded959ecb17830fb8c34f2db3.zip
Add support for Dune (#4263)
* Add support for dune * Add test * Undo reformatting of Markdown file * Refer to ale-ocaml-dune from ale.txt
Diffstat (limited to 'test')
-rw-r--r--test/fixers/test_dune_fixer_callback.vader36
1 files changed, 36 insertions, 0 deletions
diff --git a/test/fixers/test_dune_fixer_callback.vader b/test/fixers/test_dune_fixer_callback.vader
new file mode 100644
index 00000000..7fc0733c
--- /dev/null
+++ b/test/fixers/test_dune_fixer_callback.vader
@@ -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(''))