summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorHoracio Sanson <hsanson@gmail.com>2021-12-25 00:25:47 +0900
committerGitHub <noreply@github.com>2021-12-25 00:25:47 +0900
commitdcec4b3c37880c0564b62b5a8e7ec424c64c8333 (patch)
treec435cd5179bf1c0611c5569303e34a63b3824907 /test
parent5b792c764196aeb45eb6025c6c1c9727084c2feb (diff)
downloadale-dcec4b3c37880c0564b62b5a8e7ec424c64c8333.zip
Fix 3998 - add language option to uncrustify fixer (#4007)
Diffstat (limited to 'test')
-rw-r--r--test/fixers/test_uncrustify_fixer_callback.vader79
1 files changed, 77 insertions, 2 deletions
diff --git a/test/fixers/test_uncrustify_fixer_callback.vader b/test/fixers/test_uncrustify_fixer_callback.vader
index 26b5f892..c101a31a 100644
--- a/test/fixers/test_uncrustify_fixer_callback.vader
+++ b/test/fixers/test_uncrustify_fixer_callback.vader
@@ -17,7 +17,7 @@ Execute(The clang-format callback should return the correct default values):
AssertEqual
\ {
\ 'command': ale#Escape(g:ale_c_uncrustify_executable)
- \ . ' --no-backup'
+ \ . ' --no-backup -l C'
\ },
\ ale#fixers#uncrustify#Fix(bufnr(''))
@@ -28,6 +28,81 @@ Execute(The uncrustify callback should include any additional options):
AssertEqual
\ {
\ 'command': ale#Escape(g:ale_c_uncrustify_executable)
- \ . ' --no-backup --some-option',
+ \ . ' --no-backup -l C --some-option',
+ \ },
+ \ ale#fixers#uncrustify#Fix(bufnr(''))
+
+Execute(The uncrustify callback should set proper language):
+ unlet b:ale_c_uncrustify_options
+
+ set filetype=c
+ AssertEqual
+ \ {
+ \ 'command': ale#Escape(g:ale_c_uncrustify_executable)
+ \ . ' --no-backup -l C',
+ \ },
+ \ ale#fixers#uncrustify#Fix(bufnr(''))
+
+ set filetype=cpp
+ AssertEqual
+ \ {
+ \ 'command': ale#Escape(g:ale_c_uncrustify_executable)
+ \ . ' --no-backup -l CPP',
+ \ },
+ \ ale#fixers#uncrustify#Fix(bufnr(''))
+
+ set filetype=cs
+ AssertEqual
+ \ {
+ \ 'command': ale#Escape(g:ale_c_uncrustify_executable)
+ \ . ' --no-backup -l CS',
+ \ },
+ \ ale#fixers#uncrustify#Fix(bufnr(''))
+
+ set filetype=objc
+ AssertEqual
+ \ {
+ \ 'command': ale#Escape(g:ale_c_uncrustify_executable)
+ \ . ' --no-backup -l OC',
+ \ },
+ \ ale#fixers#uncrustify#Fix(bufnr(''))
+
+ set filetype=objcpp
+ AssertEqual
+ \ {
+ \ 'command': ale#Escape(g:ale_c_uncrustify_executable)
+ \ . ' --no-backup -l OC+',
+ \ },
+ \ ale#fixers#uncrustify#Fix(bufnr(''))
+
+ set filetype=d
+ AssertEqual
+ \ {
+ \ 'command': ale#Escape(g:ale_c_uncrustify_executable)
+ \ . ' --no-backup -l D',
+ \ },
+ \ ale#fixers#uncrustify#Fix(bufnr(''))
+
+ set filetype=java
+ AssertEqual
+ \ {
+ \ 'command': ale#Escape(g:ale_c_uncrustify_executable)
+ \ . ' --no-backup -l JAVA',
+ \ },
+ \ ale#fixers#uncrustify#Fix(bufnr(''))
+
+ set filetype=vala
+ AssertEqual
+ \ {
+ \ 'command': ale#Escape(g:ale_c_uncrustify_executable)
+ \ . ' --no-backup -l VALA',
+ \ },
+ \ ale#fixers#uncrustify#Fix(bufnr(''))
+
+ set filetype=p
+ AssertEqual
+ \ {
+ \ 'command': ale#Escape(g:ale_c_uncrustify_executable)
+ \ . ' --no-backup -l PAWN',
\ },
\ ale#fixers#uncrustify#Fix(bufnr(''))