summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorjhlink <jhlink@users.noreply.github.com>2020-07-30 09:43:41 -0400
committerjhlink <jhlink@users.noreply.github.com>2020-07-30 09:43:41 -0400
commitab6aed17ab819117b3c9962961dcd1205fd314b0 (patch)
tree1cc340cf1568a5d88c91717cf55cd9a6b5b6077b /test
parentd49b06e0301bb526465ae1c058583114bf619cdf (diff)
downloadale-ab6aed17ab819117b3c9962961dcd1205fd314b0.zip
test: Find .astylerc placed with src for astyle
Diffstat (limited to 'test')
-rw-r--r--test/fixers/test_astyle_fixer_callback.vader13
-rw-r--r--test/test_cpp_project/dummy.cpp0
2 files changed, 13 insertions, 0 deletions
diff --git a/test/fixers/test_astyle_fixer_callback.vader b/test/fixers/test_astyle_fixer_callback.vader
index 1cd6b394..086d283c 100644
--- a/test/fixers/test_astyle_fixer_callback.vader
+++ b/test/fixers/test_astyle_fixer_callback.vader
@@ -81,3 +81,16 @@ Execute(The astyle callback should find nearest default option file _astylrc):
\ . ' --stdin=' . ale#Escape(targetfile)
\ },
\ ale#fixers#astyle#Fix(bufnr(''))
+
+Execute(The astyle callback should find .astylrc in the same directory as src):
+ call ale#test#SetFilename('../test_cpp_project/dummy.cpp')
+ set filetype=cpp " The test fails without this
+ let targetfile = bufname(bufnr('%'))
+
+ AssertEqual
+ \ {
+ \ 'command': ale#Escape('invalidpp')
+ \ . ' --project=.astylerc'
+ \ . ' --stdin=' . ale#Escape(targetfile)
+ \ },
+ \ ale#fixers#astyle#Fix(bufnr(''))
diff --git a/test/test_cpp_project/dummy.cpp b/test/test_cpp_project/dummy.cpp
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/test/test_cpp_project/dummy.cpp