X-Git-Url: https://git.madduck.net/etc/vim.git/blobdiff_plain/0ee596c5c5e11fc79598407eaf22f83d279f7e9e..5a4872f466ebd76ddd532bdf2798554421c53df4:/.vim/bundle/ale/test/handler/test_flawfinder_handler.vader diff --git a/.vim/bundle/ale/test/handler/test_flawfinder_handler.vader b/.vim/bundle/ale/test/handler/test_flawfinder_handler.vader new file mode 100644 index 00000000..01dd1698 --- /dev/null +++ b/.vim/bundle/ale/test/handler/test_flawfinder_handler.vader @@ -0,0 +1,47 @@ +Before: + Save b:ale_c_flawfinder_error_severity + runtime ale_linters/c/flawfinder.vim + +After: + Restore + call ale#linter#Reset() + +Execute(The Flawfinder handler should work): + AssertEqual + \ [ + \ { + \ 'lnum': 31, + \ 'col': 4, + \ 'type': 'W', + \ 'text': "(buffer) strncpy: Easily used incorrectly", + \ }, + \ ], + \ ale#handlers#flawfinder#HandleFlawfinderFormat(347, [ + \ ':31:4: [1] (buffer) strncpy:Easily used incorrectly', + \ 'foo', + \ 'bar', + \ 'baz', + \ ]) + +Execute(The Flawfinder error severity level should be configurable): + let b:ale_c_flawfinder_error_severity = 2 + + AssertEqual + \ [ + \ { + \ 'lnum': 12, + \ 'col': 4, + \ 'type': 'E', + \ 'text': "(buffer) char: Statically-sized arrays can be bad", + \ }, + \ { + \ 'lnum': 31, + \ 'col': 4, + \ 'type': 'W', + \ 'text': "(buffer) strncpy: Easily used incorrectly", + \ }, + \ ], + \ ale#handlers#flawfinder#HandleFlawfinderFormat(bufnr(''), [ + \ ':12:4: [2] (buffer) char:Statically-sized arrays can be bad', + \ ':31:4: [1] (buffer) strncpy:Easily used incorrectly', + \ ])