summaryrefslogtreecommitdiff
path: root/test/handler
diff options
context:
space:
mode:
authorBartek thindil Jasicki <thindil@laeran.pl>2020-08-07 17:43:11 +0200
committerBartek thindil Jasicki <thindil@laeran.pl>2020-08-07 17:43:11 +0200
commit973c4ea053f78d4daa6eceff36da0bbecd788077 (patch)
treef63fcce4cebada3930737a3068ec9baa3571a1b9 /test/handler
parent9a9d12cf4f3dda8ab45d38b10d5f3e01efc9b5d6 (diff)
parentf741245f11007819e81632e13690ebcf9b6c3f40 (diff)
downloadale-973c4ea053f78d4daa6eceff36da0bbecd788077.zip
Merge remote-tracking branch 'upstream/master'
Diffstat (limited to 'test/handler')
-rw-r--r--test/handler/test_cppcheck_handler.vader26
-rw-r--r--test/handler/test_go_generic_handler.vader16
-rw-r--r--test/handler/test_markdownlint_handler.vader14
3 files changed, 49 insertions, 7 deletions
diff --git a/test/handler/test_cppcheck_handler.vader b/test/handler/test_cppcheck_handler.vader
index f153b9b5..55a5d29b 100644
--- a/test/handler/test_cppcheck_handler.vader
+++ b/test/handler/test_cppcheck_handler.vader
@@ -10,19 +10,29 @@ Execute(Basic errors should be handled by cppcheck):
AssertEqual
\ [
\ {
- \ 'lnum': 5,
+ \ 'lnum': 974,
+ \ 'col' : 6,
\ 'type': 'E',
- \ 'text': 'Array ''a[10]'' accessed at index 10, which is out of bounds',
+ \ 'sub_type': '',
+ \ 'text': 'Array ''n[3]'' accessed at index 3, which is out of bounds.',
+ \ 'code': 'arrayIndexOutOfBounds'
\ },
\ {
- \ 'lnum': 7,
+ \ 'lnum': 1185,
+ \ 'col' : 10,
\ 'type': 'W',
- \ 'text': 'Some other problem',
+ \ 'sub_type': 'style',
+ \ 'text': 'The scope of the variable ''indxStr'' can be reduced.',
+ \ 'code': 'variableScope'
\ },
\ ],
\ 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',
+ \ 'test.cpp:974:6: error: Array ''n[3]'' accessed at index 3, which is out of bounds. [arrayIndexOutOfBounds]\',
+ \ ' n[3]=3;',
+ \ ' ^',
+ \ 'test.cpp:1185:10: style: The scope of the variable ''indxStr'' can be reduced. [variableScope]\',
+ \ ' char indxStr[16];',
+ \ ' ^',
\ ])
Execute(Problems from other files should be ignored by cppcheck):
@@ -32,5 +42,7 @@ Execute(Problems from other files should be ignored by cppcheck):
\ [
\ ],
\ ale#handlers#cppcheck#HandleCppCheckFormat(bufnr(''), [
- \ '[bar.cpp:5]: (error) Array ''a[10]'' accessed at index 10, which is out of bounds',
+ \ 'bar.cpp:974:6: error: Array ''n[3]'' accessed at index 3, which is out of bounds. [arrayIndexOutOfBounds]\',
+ \ ' n[3]=3;',
+ \ ' ^',
\ ])
diff --git a/test/handler/test_go_generic_handler.vader b/test/handler/test_go_generic_handler.vader
index 624e56c1..2b17fdcb 100644
--- a/test/handler/test_go_generic_handler.vader
+++ b/test/handler/test_go_generic_handler.vader
@@ -15,8 +15,24 @@ Execute(The golang handler should return the correct filenames):
\ 'type': 'E',
\ 'filename': ale#path#Simplify(expand('%:p:h') . '/other.go'),
\ },
+ \ {
+ \ 'lnum': 18,
+ \ 'col': 0,
+ \ 'text': 'random error',
+ \ 'type': 'E',
+ \ 'filename': ale#path#Simplify(expand('%:p:h') . '/go1.14.go'),
+ \ },
+ \ {
+ \ 'lnum': 36,
+ \ 'col': 2,
+ \ 'text': 'another random error',
+ \ 'type': 'E',
+ \ 'filename': ale#path#Simplify(expand('%:p:h') . '/anothergo1.14.go'),
+ \ },
\ ],
\ ale#handlers#go#Handler(bufnr(''), [
\ 'test.go:27: some error',
\ 'other.go:27:5: some error with a column',
+ \ 'vet: go1.14.go:18:0: random error',
+ \ 'vet: anothergo1.14.go:36:2: another random error',
\ ])
diff --git a/test/handler/test_markdownlint_handler.vader b/test/handler/test_markdownlint_handler.vader
index 8e9f77a0..f2e6e328 100644
--- a/test/handler/test_markdownlint_handler.vader
+++ b/test/handler/test_markdownlint_handler.vader
@@ -75,3 +75,17 @@ Execute(The Markdownlint handler should parse post v0.22.0 output with column co
\ ale#handlers#markdownlint#Handle(0, [
\ 'README.md:10:20 MD013/line-length Line length [Expected: 80; Actual: 114]'
\ ])
+
+Execute(The Markdownlint handler should parse output with multiple slashes in rule name correctly):
+ AssertEqual
+ \ [
+ \ {
+ \ 'lnum': 10,
+ \ 'code': 'MD022/blanks-around-headings/blanks-around-headers',
+ \ 'text': 'Headings should be surrounded by blank lines [Expected: 1; Actual: 0; Above] [Context: "### something"]',
+ \ 'type': 'W'
+ \ }
+ \ ],
+ \ ale#handlers#markdownlint#Handle(0, [
+ \ 'README.md:10 MD022/blanks-around-headings/blanks-around-headers Headings should be surrounded by blank lines [Expected: 1; Actual: 0; Above] [Context: "### something"]'
+ \ ])