]> git.madduck.net Git - etc/vim.git/blob - .vim/bundle/ale/test/handler/test_flawfinder_handler.vader

madduck's git repository

Every one of the projects in this repository is available at the canonical URL git://git.madduck.net/madduck/pub/<projectpath> — see each project's metadata for the exact URL.

All patches and comments are welcome. Please squash your changes to logical commits before using git-format-patch and git-send-email to patches@git.madduck.net. If you'd read over the Git project's submission guidelines and adhered to them, I'd be especially grateful.

SSH access, as well as push access can be individually arranged.

If you use my repositories frequently, consider adding the following snippet to ~/.gitconfig and using the third clone URL listed for each project:

[url "git://git.madduck.net/madduck/"]
  insteadOf = madduck:

Merge commit 'd49e95aa7ba744f0a7f544aca43afdb6aab41f24' as '.vim/bundle/asyncomplete...
[etc/vim.git] / .vim / bundle / ale / test / handler / test_flawfinder_handler.vader
1 Before:
2   Save b:ale_c_flawfinder_error_severity
3   runtime ale_linters/c/flawfinder.vim
4
5 After:
6   Restore
7   call ale#linter#Reset()
8
9 Execute(The Flawfinder handler should work):
10   AssertEqual
11   \ [
12     \   {
13   \     'lnum': 31,
14   \     'col': 4,
15   \     'type': 'W',
16   \     'text': "(buffer) strncpy: Easily used incorrectly",
17   \   },
18   \ ],
19   \ ale#handlers#flawfinder#HandleFlawfinderFormat(347, [
20   \   '<stdin>:31:4:  [1] (buffer) strncpy:Easily used incorrectly',
21   \   'foo',
22   \   'bar',
23   \   'baz',
24   \ ])
25
26 Execute(The Flawfinder error severity level should be configurable):
27   let b:ale_c_flawfinder_error_severity = 2
28
29   AssertEqual
30   \ [
31   \   {
32   \     'lnum': 12,
33   \     'col': 4,
34   \     'type': 'E',
35   \     'text': "(buffer) char: Statically-sized arrays can be bad",
36   \   },
37   \   {
38   \     'lnum': 31,
39   \     'col': 4,
40   \     'type': 'W',
41   \     'text': "(buffer) strncpy: Easily used incorrectly",
42   \   },
43   \ ],
44   \ ale#handlers#flawfinder#HandleFlawfinderFormat(bufnr(''), [
45   \   '<stdin>:12:4:  [2] (buffer) char:Statically-sized arrays can be bad',
46   \   '<stdin>:31:4:  [1] (buffer) strncpy:Easily used incorrectly',
47   \ ])