summaryrefslogtreecommitdiff
path: root/test/fixers
diff options
context:
space:
mode:
authorAntoine Gagné <AntoineGagne@users.noreply.github.com>2021-02-28 08:31:44 -0500
committerGitHub <noreply@github.com>2021-02-28 22:31:44 +0900
commit48fab99a0ab793e1b9607795c21659f12bd6947f (patch)
tree5d554e05d76fb9197e3c89e806490f4cd98b0fac /test/fixers
parent038e4a8c31feb03beea02c09d953affc8c460515 (diff)
downloadale-48fab99a0ab793e1b9607795c21659f12bd6947f.zip
Add support for `erlfmt` fixer (#3602)
* Add support for `erlfmt` * Add missing entry to table of contents * Fix warnings * Add missing tools to supported tools
Diffstat (limited to 'test/fixers')
-rw-r--r--test/fixers/test_erlfmt_fixer_callback.vader25
1 files changed, 25 insertions, 0 deletions
diff --git a/test/fixers/test_erlfmt_fixer_callback.vader b/test/fixers/test_erlfmt_fixer_callback.vader
new file mode 100644
index 00000000..132cd6ee
--- /dev/null
+++ b/test/fixers/test_erlfmt_fixer_callback.vader
@@ -0,0 +1,25 @@
+Before:
+ Save b:ale_elm_format_executable
+ Save b:ale_elm_format_options
+
+ let b:ale_elm_format_executable = 'erlfmt'
+ let b:ale_elm_format_options = ''
+
+After:
+ Restore
+
+Execute(The erlfmt command should handle empty options):
+ AssertEqual
+ \ {
+ \ 'command': ale#Escape('erlfmt') . ' %s'
+ \ },
+ \ ale#fixers#erlfmt#Fix(bufnr(''))
+
+Execute(The erlfmt command should handle custom options):
+ let b:ale_erlang_erlfmt_options = '--insert-pragma'
+
+ AssertEqual
+ \ {
+ \ 'command': ale#Escape('erlfmt') . ' --insert-pragma %s'
+ \ },
+ \ ale#fixers#erlfmt#Fix(bufnr(''))