summaryrefslogtreecommitdiff
path: root/test/fixers
diff options
context:
space:
mode:
authorDavid Houston <houstdav000@gmail.com>2021-03-23 20:02:17 -0400
committerGitHub <noreply@github.com>2021-03-24 09:02:17 +0900
commitb1f95dc4fb15efb1d5238845c99548f2906e2ba3 (patch)
tree669b5cba5963b96624628cdc7160b6ba3ef99571 /test/fixers
parenteb0ebe622102cc6da3d7e943a3b739db7b6ed216 (diff)
downloadale-b1f95dc4fb15efb1d5238845c99548f2906e2ba3.zip
Add nixfmt as a Nix fixer. (#3651)
* Add nixfmt fixer. * Replace manual options pad with ale#Pad()
Diffstat (limited to 'test/fixers')
-rw-r--r--test/fixers/test_nixfmt_fixer_callback.vader24
1 files changed, 24 insertions, 0 deletions
diff --git a/test/fixers/test_nixfmt_fixer_callback.vader b/test/fixers/test_nixfmt_fixer_callback.vader
new file mode 100644
index 00000000..880ac83e
--- /dev/null
+++ b/test/fixers/test_nixfmt_fixer_callback.vader
@@ -0,0 +1,24 @@
+Before:
+ Save g:ale_nix_nixfmt_executable
+ Save g:ale_nix_nixfmt_options
+
+After:
+ Restore
+
+Execute(The nixfmt callback should return the correct default values):
+ AssertEqual
+ \ {
+ \ 'command': ale#Escape('nixfmt')
+ \ },
+ \ ale#fixers#nixfmt#Fix(bufnr(''))
+
+Execute(The nixfmt executable and options should be configurable):
+ let g:ale_nix_nixfmt_executable = '/path/to/nixfmt'
+ let g:ale_nix_nixfmt_options = '--help'
+
+ AssertEqual
+ \ {
+ \ 'command': ale#Escape('/path/to/nixfmt')
+ \ . ' --help',
+ \ },
+ \ ale#fixers#nixfmt#Fix(bufnr(''))