2017-06-22 09:08:58 -04:00
|
|
|
Before:
|
2017-07-09 17:43:25 -04:00
|
|
|
call ale#test#SetDirectory('/testplugin/test/handler')
|
2017-06-22 09:08:58 -04:00
|
|
|
|
|
|
|
After:
|
2017-07-09 17:43:25 -04:00
|
|
|
call ale#test#RestoreDirectory()
|
2017-06-22 09:08:58 -04:00
|
|
|
|
|
|
|
Execute(Basic errors should be handled by cppcheck):
|
|
|
|
call ale#test#SetFilename('test.cpp')
|
|
|
|
|
|
|
|
AssertEqual
|
|
|
|
\ [
|
|
|
|
\ {
|
|
|
|
\ 'lnum': 5,
|
|
|
|
\ 'type': 'E',
|
|
|
|
\ 'text': 'Array ''a[10]'' accessed at index 10, which is out of bounds',
|
|
|
|
\ },
|
|
|
|
\ {
|
|
|
|
\ 'lnum': 7,
|
|
|
|
\ 'type': 'W',
|
|
|
|
\ 'text': 'Some other problem',
|
|
|
|
\ },
|
|
|
|
\ ],
|
|
|
|
\ ale#handlers#cppcheck#HandleCppCheckFormat(bufnr(''), [
|
|
|
|
\ '[test.cpp:5]: (error) Array ''a[10]'' accessed at index 10, which is out of bounds',
|
|
|
|
\ '[test.cpp:7]: (warning) Some other problem',
|
|
|
|
\ ])
|
|
|
|
|
|
|
|
Execute(Problems from other files should be ignored by cppcheck):
|
|
|
|
call ale#test#SetFilename('test.cpp')
|
|
|
|
|
|
|
|
AssertEqual
|
|
|
|
\ [
|
|
|
|
\ ],
|
|
|
|
\ ale#handlers#cppcheck#HandleCppCheckFormat(bufnr(''), [
|
|
|
|
\ '[bar.cpp:5]: (error) Array ''a[10]'' accessed at index 10, which is out of bounds',
|
|
|
|
\ ])
|