Merge #1642
1642: Add test for #1540 r=matklad a=kjeremy Co-authored-by: Jeremy Kolb <kjeremy@gmail.com>
This commit is contained in:
commit
a490f80a9c
@ -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```"
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user