aboutsummaryrefslogtreecommitdiff
path: root/crates
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2019-08-05 11:12:24 +0100
committerbors[bot] <26634292+bors[bot]@users.noreply.github.com>2019-08-05 11:12:24 +0100
commita490f80a9c49380c5088b704047bb20b76c06e4d (patch)
tree24d28b022231a61268319c2092c988c6a9c61b06 /crates
parent4912cc35afe96b1506e5cda1be34d3e2418bc702 (diff)
parente99d3da6c27eb62021c3209ee80bf2245c563662 (diff)
Merge #1642
1642: Add test for #1540 r=matklad a=kjeremy Co-authored-by: Jeremy Kolb <[email protected]>
Diffstat (limited to 'crates')
-rw-r--r--crates/ra_lsp_server/src/markdown.rs17
1 files changed, 17 insertions, 0 deletions
diff --git a/crates/ra_lsp_server/src/markdown.rs b/crates/ra_lsp_server/src/markdown.rs
index 947ef77cd..c1eb0236a 100644
--- a/crates/ra_lsp_server/src/markdown.rs
+++ b/crates/ra_lsp_server/src/markdown.rs
@@ -54,4 +54,21 @@ mod tests {
54 let comment = "this\nis\nultiline"; 54 let comment = "this\nis\nultiline";
55 assert_eq!(format_docs(comment), comment); 55 assert_eq!(format_docs(comment), comment);
56 } 56 }
57
58 #[test]
59 fn test_code_blocks_in_comments_marked_as_rust() {
60 let comment = r#"```rust
61fn main(){}
62```
63Some comment.
64```
65let a = 1;
66```"#;
67
68 assert_eq!(
69 format_docs(comment),
70 "```rust\nfn main(){}\n```\nSome comment.\n```rust\nlet a = 1;\n```"
71 );
72 }
73
57} 74}