mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-01 22:31:43 +00:00
Add test for #1540
This commit is contained in:
parent
0e94d07b9c
commit
e99d3da6c2
1 changed files with 17 additions and 0 deletions
|
@ -54,4 +54,21 @@ mod tests {
|
||||||
let comment = "this\nis\nultiline";
|
let comment = "this\nis\nultiline";
|
||||||
assert_eq!(format_docs(comment), comment);
|
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```"
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue