mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 04:44:57 +00:00
Add explicit newline preserving tests
This commit is contained in:
parent
4a6cfa1aa7
commit
4fccad9b2c
2 changed files with 23 additions and 0 deletions
|
@ -121,6 +121,23 @@ fn test_doc_comment_preserves_indents() {
|
|||
assert_eq!("doc1\n```\nfn foo() {\n // ...\n}\n```", module.doc_comment_text().unwrap());
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_doc_comment_preserves_newlines() {
|
||||
let file = SourceFile::parse(
|
||||
r#"
|
||||
/// this
|
||||
/// is
|
||||
/// mod
|
||||
/// foo
|
||||
mod foo {}
|
||||
"#,
|
||||
)
|
||||
.ok()
|
||||
.unwrap();
|
||||
let module = file.syntax().descendants().find_map(Module::cast).unwrap();
|
||||
assert_eq!("this\nis\nmod\nfoo", module.doc_comment_text().unwrap());
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_where_predicates() {
|
||||
fn assert_bound(text: &str, bound: Option<TypeBound>) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue