summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-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(''))