summaryrefslogtreecommitdiff
path: root/test/fixers
diff options
context:
space:
mode:
authorDavid Wood <david@davidtw.co>2019-11-19 21:15:35 +0000
committerDavid Wood <david@davidtw.co>2020-10-23 11:48:21 +0100
commitb496c4b1648cd15f8f6918d7c29853a8a04525c4 (patch)
treea02fc3092d358b4a7562c0b2aebe8b7e9118bdf1 /test/fixers
parent557a1ed5da70cb443a8650766f4e8ea95e8c0da3 (diff)
downloadale-b496c4b1648cd15f8f6918d7c29853a8a04525c4.zip
Add ormolu fixer.
This commit adds a fixer for the Haskell language, ormolu (https://github.com/tweag/ormolu). Signed-off-by: David Wood <david@davidtw.co>
Diffstat (limited to 'test/fixers')
-rw-r--r--test/fixers/test_ormolu_fixer_callback.vader24
1 files changed, 24 insertions, 0 deletions
diff --git a/test/fixers/test_ormolu_fixer_callback.vader b/test/fixers/test_ormolu_fixer_callback.vader
new file mode 100644
index 00000000..8df3fca9
--- /dev/null
+++ b/test/fixers/test_ormolu_fixer_callback.vader
@@ -0,0 +1,24 @@
+Before:
+ Save g:ale_haskell_ormolu_executable
+ Save g:ale_haskell_ormolu_options
+
+After:
+ Restore
+
+Execute(The ormolu callback should return the correct default values):
+ AssertEqual
+ \ {
+ \ 'command': ale#Escape('ormolu')
+ \ },
+ \ ale#fixers#ormolu#Fix(bufnr(''))
+
+Execute(The ormolu executable and options should be configurable):
+ let g:ale_nix_nixpkgsfmt_executable = '/path/to/ormolu'
+ let g:ale_nix_nixpkgsfmt_options = '-h'
+
+ AssertEqual
+ \ {
+ \ 'command': ale#Escape('/path/to/ormolu')
+ \ . ' -h',
+ \ },
+ \ ale#fixers#nixpkgsfmt#Fix(bufnr(''))