mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 04:44:57 +00:00
Add test
The rename function should not change any path segments that refer to a module by super.
This commit is contained in:
parent
9b1978a3ed
commit
add80bccfc
1 changed files with 25 additions and 0 deletions
|
@ -1108,6 +1108,31 @@ pub mod foo$0;
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn test_rename_mod_ref_by_super() {
|
||||||
|
check(
|
||||||
|
"baz",
|
||||||
|
r#"
|
||||||
|
mod $0foo {
|
||||||
|
struct X;
|
||||||
|
|
||||||
|
mod bar {
|
||||||
|
use super::X;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
"#,
|
||||||
|
r#"
|
||||||
|
mod baz {
|
||||||
|
struct X;
|
||||||
|
|
||||||
|
mod bar {
|
||||||
|
use super::X;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
"#,
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_enum_variant_from_module_1() {
|
fn test_enum_variant_from_module_1() {
|
||||||
cov_mark::check!(rename_non_local);
|
cov_mark::check!(rename_non_local);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue