summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorjhlink <jhlink@users.noreply.github.com>2020-07-10 18:26:15 -0400
committerjhlink <jhlink@users.noreply.github.com>2020-07-10 18:26:15 -0400
commitfecffeee91eb4670810d314ac5f97b2d776a675c (patch)
tree98fc0a799a97602ccb06057ea7ea4d6bdee8c3f0 /test
parent56b92544c2ec310165c9a6d504051a77042b1855 (diff)
downloadale-fecffeee91eb4670810d314ac5f97b2d776a675c.zip
test: Add astyle vader test
Diffstat (limited to 'test')
-rw-r--r--test/fixers/test_astyle_fixer_callback.vader23
1 files changed, 23 insertions, 0 deletions
diff --git a/test/fixers/test_astyle_fixer_callback.vader b/test/fixers/test_astyle_fixer_callback.vader
new file mode 100644
index 00000000..2fc57ad0
--- /dev/null
+++ b/test/fixers/test_astyle_fixer_callback.vader
@@ -0,0 +1,23 @@
+Before:
+ Save g:ale_c_astyle_executable
+
+ " Use an invalid global executable, so we don't match it.
+ let g:ale_c_astyle_executable = 'xxxinvalid'
+
+ call ale#test#SetDirectory('/testplugin/test/fixers')
+
+After:
+ Restore
+
+ call ale#test#RestoreDirectory()
+
+Execute(The astyle callback should return the correct default values):
+ call ale#test#SetFilename('../c_files/testfile.c')
+
+ AssertEqual
+ \ {
+ \ 'read_temporary_file': 1,
+ \ 'command': ale#Escape('xxxinvalid')
+ \ . ' %t',
+ \ },
+ \ ale#fixers#astyle#Fix(bufnr(''))