Unnamed repository; edit this file 'description' to name the repository.
Add test for comments not directly next to items
Wesley Norris 2022-01-18
parent 7d10752 · commit ba82cc7
-rw-r--r--crates/ide_db/src/helpers/insert_use/tests.rs17
1 files changed, 17 insertions, 0 deletions
diff --git a/crates/ide_db/src/helpers/insert_use/tests.rs b/crates/ide_db/src/helpers/insert_use/tests.rs
index 887319e924..4219358a07 100644
--- a/crates/ide_db/src/helpers/insert_use/tests.rs
+++ b/crates/ide_db/src/helpers/insert_use/tests.rs
@@ -430,6 +430,23 @@ fn foo() {}"#,
}
#[test]
+fn inserts_after_single_line_header_comments_and_before_item() {
+ check_none(
+ "foo::bar::Baz",
+ r#"// Represents a possible license header
+// Line two of possible license header
+
+fn foo() {}"#,
+ r#"// Represents a possible license header
+// Line two of possible license header
+
+use foo::bar::Baz;
+
+fn foo() {}"#,
+ );
+}
+
+#[test]
fn inserts_after_multiline_inner_comments() {
check_none(
"foo::bar::Baz",