summaryrefslogtreecommitdiff
path: root/test/lsp
diff options
context:
space:
mode:
authorJethro Shuwen Sun <jethro.sun7@gmail.com>2019-04-15 09:36:18 -0400
committerw0rp <w0rp@users.noreply.github.com>2019-04-15 14:36:18 +0100
commit7f31065fce89cca492c21c8bd73c74aa9f9432b2 (patch)
tree2f385d021a66b0d426948f5d4cd86fd8b75657d2 /test/lsp
parent61c1ddd90429c2604867358aedc2456b560845f9 (diff)
downloadale-7f31065fce89cca492c21c8bd73c74aa9f9432b2.zip
improve the lsp diagnostic message format (#2425)
Diffstat (limited to 'test/lsp')
-rw-r--r--test/lsp/test_read_lsp_diagnostics.vader20
1 files changed, 20 insertions, 0 deletions
diff --git a/test/lsp/test_read_lsp_diagnostics.vader b/test/lsp/test_read_lsp_diagnostics.vader
index c197e0c6..377e73d9 100644
--- a/test/lsp/test_read_lsp_diagnostics.vader
+++ b/test/lsp/test_read_lsp_diagnostics.vader
@@ -109,6 +109,26 @@ Execute(ale#lsp#response#ReadDiagnostics() should include sources in detail):
\ }
\ ]}})
+Execute(ale#lsp#response#ReadDiagnostics() should keep detail with line breaks but replace with spaces in text):
+ AssertEqual [
+ \ {
+ \ 'type': 'E',
+ \ 'text': 'cannot borrow `cap` as mutable more than once at a time mutable borrow starts here in previous iteration of loop',
+ \ 'detail': "[rustc] cannot borrow `cap` as mutable\r\nmore than once at a time\n\nmutable borrow starts here\rin previous iteration of loop",
+ \ 'lnum': 10,
+ \ 'col': 15,
+ \ 'end_lnum': 12,
+ \ 'end_col': 22,
+ \ }
+ \ ],
+ \ ale#lsp#response#ReadDiagnostics({'params': {'uri': 'filename.ts', 'diagnostics': [
+ \ {
+ \ 'range': Range(9, 14, 11, 22),
+ \ 'message': "cannot borrow `cap` as mutable\r\nmore than once at a time\n\nmutable borrow starts here\rin previous iteration of loop",
+ \ 'source': 'rustc',
+ \ }
+ \ ]}})
+
Execute(ale#lsp#response#ReadDiagnostics() should consider -1 to be a meaningless code):
AssertEqual [
\ {