diff options
author | w0rp <devw0rp@gmail.com> | 2017-06-21 22:33:34 +0100 |
---|---|---|
committer | w0rp <devw0rp@gmail.com> | 2017-06-21 22:33:34 +0100 |
commit | dab6f39eb0b5d0dd77a8dc3fe58d0648d82696f7 (patch) | |
tree | 18faefa99cc56fee65db35c007c0e2e267166cc6 /test/command_callback/test_cppcheck_command_callbacks.vader | |
parent | ab534c2995dabfb8adcdc62d0ac66ed1b1110f4c (diff) | |
download | ale-dab6f39eb0b5d0dd77a8dc3fe58d0648d82696f7.zip |
Fix some escaping and make some tests set filenames consistently
Diffstat (limited to 'test/command_callback/test_cppcheck_command_callbacks.vader')
-rw-r--r-- | test/command_callback/test_cppcheck_command_callbacks.vader | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/test/command_callback/test_cppcheck_command_callbacks.vader b/test/command_callback/test_cppcheck_command_callbacks.vader index 63958643..69bb214d 100644 --- a/test/command_callback/test_cppcheck_command_callbacks.vader +++ b/test/command_callback/test_cppcheck_command_callbacks.vader @@ -5,36 +5,43 @@ Before: After: silent execute 'cd ' . fnameescape(b:dir) unlet! b:dir + call ale#linter#Reset() Execute(The default C cppcheck command should be correct): runtime ale_linters/c/cppcheck.vim + call ale#test#SetFilename('cppcheck_paths/two/foo.cpp') + AssertEqual \ 'cppcheck -q --language=c --enable=style %t', \ ale_linters#c#cppcheck#GetCommand(bufnr('')) Execute(cppcheck for C should detect compile_commands.json files): runtime ale_linters/c/cppcheck.vim - cd cppcheck_paths/one + + call ale#test#SetFilename('cppcheck_paths/one/foo.cpp') AssertEqual - \ 'cd ' . shellescape(b:dir . '/cppcheck_paths/one') . ' && ' + \ 'cd ' . ale#Escape(b:dir . '/cppcheck_paths/one') . ' && ' \ . 'cppcheck -q --language=c --project=compile_commands.json --enable=style %t', \ ale_linters#c#cppcheck#GetCommand(bufnr('')) Execute(The default C++ cppcheck command should be correct): runtime ale_linters/cpp/cppcheck.vim + call ale#test#SetFilename('cppcheck_paths/two/foo.cpp') + AssertEqual \ 'cppcheck -q --language=c++ --enable=style %t', \ ale_linters#cpp#cppcheck#GetCommand(bufnr('')) Execute(cppcheck for C++ should detect compile_commands.json files): runtime ale_linters/cpp/cppcheck.vim - cd cppcheck_paths/one + + call ale#test#SetFilename('cppcheck_paths/one/foo.cpp') AssertEqual - \ 'cd ' . shellescape(b:dir . '/cppcheck_paths/one') . ' && ' + \ 'cd ' . ale#Escape(b:dir . '/cppcheck_paths/one') . ' && ' \ . 'cppcheck -q --language=c++ --project=compile_commands.json --enable=style %t', \ ale_linters#cpp#cppcheck#GetCommand(bufnr('')) |