aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_lsp_server/src
diff options
context:
space:
mode:
authorJeremy Kolb <[email protected]>2019-08-03 23:01:48 +0100
committerJeremy Kolb <[email protected]>2019-08-03 23:01:48 +0100
commite99d3da6c27eb62021c3209ee80bf2245c563662 (patch)
tree564669a55a42f7767bdd3aed4525ccd684910aee /crates/ra_lsp_server/src
parent0e94d07b9c6f75657ab07dbf4a42a6d2c08a139a (diff)
Add test for #1540
Diffstat (limited to 'crates/ra_lsp_server/src')
-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}