diff options
author | David Houston <houstdav000@gmail.com> | 2021-03-23 20:02:17 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-03-24 09:02:17 +0900 |
commit | b1f95dc4fb15efb1d5238845c99548f2906e2ba3 (patch) | |
tree | 669b5cba5963b96624628cdc7160b6ba3ef99571 /test/fixers | |
parent | eb0ebe622102cc6da3d7e943a3b739db7b6ed216 (diff) | |
download | ale-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.vader | 24 |
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('')) |