summaryrefslogtreecommitdiff
path: root/test/handler
diff options
context:
space:
mode:
authorw0rp <w0rp@users.noreply.github.com>2019-06-08 23:20:18 +0100
committerGitHub <noreply@github.com>2019-06-08 23:20:18 +0100
commitd9931b98910a64b81499ef9ae9d95ac4d446c67f (patch)
tree4fbec01179a5f8090b7a9b8f13867218392ef614 /test/handler
parent3aa58ca1796a57707e321645c4d9a49c84f5fdb4 (diff)
parente7317e05ea3e18d39feb4620a93c8ceec25d8a43 (diff)
downloadale-d9931b98910a64b81499ef9ae9d95ac4d446c67f.zip
Merge pull request #2559 from nerdrew/rust-cargo-rendered-detail
show rendered cargo error in detail for clippy errors
Diffstat (limited to 'test/handler')
-rw-r--r--test/handler/test_rust_handler.vader51
1 files changed, 51 insertions, 0 deletions
diff --git a/test/handler/test_rust_handler.vader b/test/handler/test_rust_handler.vader
index 56db9b36..845df2b5 100644
--- a/test/handler/test_rust_handler.vader
+++ b/test/handler/test_rust_handler.vader
@@ -247,6 +247,57 @@ Execute(The Rust handler should show detailed errors):
\ }),
\ ])
+Execute(The Rust handler should show detailed clippy errors with rendered field if it's available):
+ call ale#test#SetFilename('src/playpen.rs')
+
+ AssertEqual
+ \ [
+ \ {
+ \ 'lnum': 4,
+ \ 'end_lnum': 4,
+ \ 'type': 'E',
+ \ 'col': 21,
+ \ 'end_col': 22,
+ \ 'text': 'mismatched types: expected bool, found integral variable',
+ \ 'detail': 'this is a detailed description',
+ \ },
+ \ ],
+ \ ale#handlers#rust#HandleRustErrors(bufnr(''), [
+ \ '',
+ \ 'ignore this',
+ \ json_encode({
+ \ 'message': {
+ \ 'code': v:null,
+ \ 'level': 'error',
+ \ 'message': 'mismatched types',
+ \ 'rendered': 'this is a detailed description',
+ \ 'spans': [
+ \ {
+ \ 'byte_end': 54,
+ \ 'byte_start': 52,
+ \ 'column_end': 23,
+ \ 'column_start': 21,
+ \ 'expansion': v:null,
+ \ 'file_name': ale#path#Simplify('src/playpen.rs'),
+ \ 'is_primary': v:true,
+ \ 'label': 'expected bool, found integral variable',
+ \ 'line_end': 4,
+ \ 'line_start': 4,
+ \ }
+ \ ]
+ \ },
+ \ }),
+ \ json_encode({
+ \ 'message': {
+ \ 'code': v:null,
+ \ 'level': 'error',
+ \ 'message': 'aborting due to previous error(s)',
+ \ 'spans': [
+ \ ]
+ \ },
+ \ }),
+ \ ])
+
Execute(The Rust handler should find correct files):
call ale#test#SetFilename('src/noerrors/mod.rs')