summaryrefslogtreecommitdiff
path: root/test/fixers
diff options
context:
space:
mode:
authorjhlink <jhlink@users.noreply.github.com>2020-07-26 20:51:41 -0400
committerjhlink <jhlink@users.noreply.github.com>2020-07-26 20:51:41 -0400
commitb25bb64a4d31a343ec210c01146791a5acd3bb99 (patch)
treeaabb356f674cf3ca42b6287d7299d2d4798d20cf /test/fixers
parenta9799fe90e95468ce4d176206e3a59dd7f881fa7 (diff)
downloadale-b25bb64a4d31a343ec210c01146791a5acd3bb99.zip
feat: Use stdin/redirection for astyle
Diffstat (limited to 'test/fixers')
-rw-r--r--test/fixers/test_astyle_fixer_callback.vader15
1 files changed, 8 insertions, 7 deletions
diff --git a/test/fixers/test_astyle_fixer_callback.vader b/test/fixers/test_astyle_fixer_callback.vader
index 9eb52788..fc481d95 100644
--- a/test/fixers/test_astyle_fixer_callback.vader
+++ b/test/fixers/test_astyle_fixer_callback.vader
@@ -3,6 +3,7 @@ Before:
" Use an invalid global executable, so we don't match it.
let g:ale_c_astyle_executable = 'xxxinvalid'
+ let g:ale_cpp_astyle_executable = 'invalidpp'
call ale#test#SetDirectory('/testplugin/test/fixers')
@@ -13,24 +14,24 @@ After:
Execute(The astyle callback should return the correct default values):
call ale#test#SetFilename('../c_files/testfile.c')
+ let targetfile = '/testplugin/test/c_files/testfile.c'
AssertEqual
\ {
- \ 'read_temporary_file': 1,
- \ 'command': ale#Escape('xxxinvalid')
- \ . ' %t',
+ \ 'command': ale#Escape(g:ale_c_astyle_executable)
+ \ . ' --stdin=' . ale#Escape(targetfile)
\ },
\ ale#fixers#astyle#Fix(bufnr(''))
Execute(The astyle callback should support cpp files):
call ale#test#SetFilename('../cpp_files/dummy.cpp')
- let g:ale_cpp_astyle_executable = 'xxxinvalid'
+ let targetfile = '/testplugin/test/cpp_files/dummy.cpp'
set filetype=cpp " The test fails without this
AssertEqual
\ {
- \ 'read_temporary_file': 1,
- \ 'command': ale#Escape('xxxinvalid')
- \ . ' %t',
+ \ 'command': ale#Escape(g:ale_cpp_astyle_executable)
+ \ . ' --stdin=' . ale#Escape(targetfile)
\ },
\ ale#fixers#astyle#Fix(bufnr(''))
+