summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/fixers/test_fourmolu_fixer_callback.vader29
1 files changed, 29 insertions, 0 deletions
diff --git a/test/fixers/test_fourmolu_fixer_callback.vader b/test/fixers/test_fourmolu_fixer_callback.vader
new file mode 100644
index 00000000..728c02ed
--- /dev/null
+++ b/test/fixers/test_fourmolu_fixer_callback.vader
@@ -0,0 +1,29 @@
+Before:
+ Save g:ale_haskell_fourmolu_executable
+ Save g:ale_haskell_fourmolu_options
+
+After:
+ Restore
+
+Execute(The fourmolu callback should return the correct default values):
+ AssertEqual
+ \ {
+ \ 'command': ale#Escape('fourmolu')
+ \ . ' --stdin-input-file '
+ \ . ale#Escape(@%)
+ \ },
+ \ ale#fixers#fourmolu#Fix(bufnr(''))
+
+Execute(The fourmolu executable and options should be configurable):
+ let g:ale_haskell_fourmolu_executable = '/path/to/fourmolu'
+ let g:ale_haskell_fourmolu_options = '-h'
+
+ AssertEqual
+ \ {
+ \ 'command': ale#Escape('/path/to/fourmolu')
+ \ . ' -h'
+ \ . ' --stdin-input-file '
+ \ . ale#Escape(@%)
+ \ },
+ \ ale#fixers#fourmolu#Fix(bufnr(''))
+