summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorKanenobu Mitsuru <mkanenobu@users.noreply.github.com>2019-05-08 02:50:26 +0900
committerw0rp <w0rp@users.noreply.github.com>2019-05-07 18:50:26 +0100
commitc10da0e390b37ae6a739769dffb3b8dcf36a81d0 (patch)
treef0c61aca339761b7b75c2ef529cccffd38600072 /test
parent548ee56f401bf3dea7689b0b00c8fbecd2db48b1 (diff)
downloadale-c10da0e390b37ae6a739769dffb3b8dcf36a81d0.zip
Add fixer for OCaml ocp-indent (#2436)
Diffstat (limited to 'test')
-rw-r--r--test/fixers/test_ocp_indent_fixer_callback.vader34
1 files changed, 34 insertions, 0 deletions
diff --git a/test/fixers/test_ocp_indent_fixer_callback.vader b/test/fixers/test_ocp_indent_fixer_callback.vader
new file mode 100644
index 00000000..1f61f383
--- /dev/null
+++ b/test/fixers/test_ocp_indent_fixer_callback.vader
@@ -0,0 +1,34 @@
+Before:
+ Save g:ale_ocaml_ocp_indent_executable
+ Save g:ale_ocaml_ocpindent_options
+
+ " Use an invalid global executable
+ let g:ale_ocaml_ocp_indent_executable = 'xxxinvalid'
+ let g:ale_ocaml_ocp_indent_options = ''
+
+ call ale#test#SetDirectory('/testplugin/test/fixers')
+
+After:
+ Restore
+
+ call ale#test#RestoreDirectory()
+
+Execute(The ocp_indent callback should return the correct default values):
+ call ale#test#SetFilename('../ocaml-test-files/ocp_inden_testfile.re')
+
+ AssertEqual
+ \ {
+ \ 'command': ale#Escape('xxxinvalid')
+ \ },
+ \ ale#fixers#ocp_indent#Fix(bufnr(''))
+
+Execute(The ocp_indent callback should include custom ocp_indent options):
+ let g:ale_ocaml_ocp_indent_config = "base=4, type=4"
+ call ale#test#SetFilename('../ocaml-test-files/ocp_inden_testfile.re')
+
+ AssertEqual
+ \ {
+ \ 'command': ale#Escape('xxxinvalid')
+ \ . ' --config=' . ale#Escape(g:ale_ocaml_ocp_indent_config)
+ \ },
+ \ ale#fixers#ocp_indent#Fix(bufnr(''))