Skip to content

Commit add80bc

Browse files
committed
Add test
The rename function should not change any path segments that refer to a module by super.
1 parent 9b1978a commit add80bc

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

crates/ide/src/rename.rs

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1108,6 +1108,31 @@ pub mod foo$0;
11081108
);
11091109
}
11101110

1111+
#[test]
1112+
fn test_rename_mod_ref_by_super() {
1113+
check(
1114+
"baz",
1115+
r#"
1116+
mod $0foo {
1117+
struct X;
1118+
1119+
mod bar {
1120+
use super::X;
1121+
}
1122+
}
1123+
"#,
1124+
r#"
1125+
mod baz {
1126+
struct X;
1127+
1128+
mod bar {
1129+
use super::X;
1130+
}
1131+
}
1132+
"#,
1133+
)
1134+
}
1135+
11111136
#[test]
11121137
fn test_enum_variant_from_module_1() {
11131138
cov_mark::check!(rename_non_local);

0 commit comments

Comments
 (0)