summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorPat Brisbin <pbrisbin@gmail.com>2023-04-22 09:05:50 -0400
committerGitHub <noreply@github.com>2023-04-22 22:05:50 +0900
commit61248e1453dc6373160154e1f6855ffc510a7dfc (patch)
tree4ea12558911cc79317c9adf5961321428bcd8265 /test
parentfdadaed2ba93432add241bb25f9935dc2ebb4152 (diff)
downloadale-61248e1453dc6373160154e1f6855ffc510a7dfc.zip
Add fourmolu fixer (#4501)
* Add fourmolu fixer Fourmolu is aversion of Ormolu that supports configuration. This fixer was modeled after the Ormolu one, but using the "stack executable" approach of the Brittany and Stylish Haskell fixers. * Sort supported-tools.md
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(''))
+