diff options
Diffstat (limited to 'test/test_common_handlers.vader')
-rw-r--r-- | test/test_common_handlers.vader | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/test/test_common_handlers.vader b/test/test_common_handlers.vader index 678b9337..6fee00b8 100644 --- a/test/test_common_handlers.vader +++ b/test/test_common_handlers.vader @@ -138,5 +138,33 @@ Then (The loclist should be correct): \ }, \], g:loclist +Execute (Run HandleCppCheckFormat): + let g:loclist = ale#handlers#HandleCppCheckFormat(42, [ + \ '[/tmp/test.c:5]: (style) Variable a is assigned a value that is never used.', + \ '[/tmp/test.c:12]: (error) Array a[10] accessed at index 10, which is out of bounds.' + \]) + +Then (The loclist should be correct): + AssertEqual [ + \ { + \ 'bufnr': 42, + \ 'vcol': 0, + \ 'nr': -1, + \ 'lnum': 5, + \ 'col': 0, + \ 'type': 'W', + \ 'text': 'Variable a is assigned a value that is never used. (style)', + \ }, + \ { + \ 'bufnr': 42, + \ 'vcol': 0, + \ 'nr': -1, + \ 'lnum': 12, + \ 'col': 0, + \ 'type': 'E', + \ 'text': 'Array a[10] accessed at index 10, which is out of bounds. (error)', + \ }, + \], g:loclist + After: unlet g:loclist |