From e99d3da6c27eb62021c3209ee80bf2245c563662 Mon Sep 17 00:00:00 2001 From: Jeremy Kolb Date: Sat, 3 Aug 2019 18:01:48 -0400 Subject: Add test for #1540 --- crates/ra_lsp_server/src/markdown.rs | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'crates/ra_lsp_server') 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 { let comment = "this\nis\nultiline"; assert_eq!(format_docs(comment), comment); } + + #[test] + fn test_code_blocks_in_comments_marked_as_rust() { + let comment = r#"```rust +fn main(){} +``` +Some comment. +``` +let a = 1; +```"#; + + assert_eq!( + format_docs(comment), + "```rust\nfn main(){}\n```\nSome comment.\n```rust\nlet a = 1;\n```" + ); + } + } -- cgit v1.2.3