Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/ide-assists/src/tests/sourcegen.rs')
| -rw-r--r-- | crates/ide-assists/src/tests/sourcegen.rs | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/crates/ide-assists/src/tests/sourcegen.rs b/crates/ide-assists/src/tests/sourcegen.rs index d45e54186b..577bc0894e 100644 --- a/crates/ide-assists/src/tests/sourcegen.rs +++ b/crates/ide-assists/src/tests/sourcegen.rs @@ -31,7 +31,7 @@ r#####" }} "######, &test_id, - &assist.id, + §ion.assist_id, reveal_hash_comments(§ion.before), reveal_hash_comments(§ion.after) ); @@ -61,6 +61,7 @@ r#####" } #[derive(Debug)] struct Section { + assist_id: String, doc: String, before: String, after: String, @@ -111,11 +112,13 @@ impl Assist { let before = take_until(lines.by_ref(), "```"); - assert_eq!(lines.next().unwrap().as_str(), "->"); + let arrow = lines.next().unwrap(); + assert!(arrow.starts_with("->")); + let id = if arrow[2..].is_empty() { &assist.id } else { &arrow[2..] }; assert_eq!(lines.next().unwrap().as_str(), "```"); let after = take_until(lines.by_ref(), "```"); - assist.sections.push(Section { doc, before, after }); + assist.sections.push(Section { assist_id: id.to_string(), doc, before, after }); } acc.push(assist) |