From ab6aed17ab819117b3c9962961dcd1205fd314b0 Mon Sep 17 00:00:00 2001 From: jhlink Date: Thu, 30 Jul 2020 09:43:41 -0400 Subject: test: Find .astylerc placed with src for astyle --- test/fixers/test_astyle_fixer_callback.vader | 13 +++++++++++++ test/test_cpp_project/dummy.cpp | 0 2 files changed, 13 insertions(+) create mode 100644 test/test_cpp_project/dummy.cpp (limited to 'test') 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 -- cgit v1.2.3