about summary refs log tree commit diff
diff options
context:
space:
mode:
authorTheDoctor314 <64731940+TheDoctor314@users.noreply.github.com>2022-02-08 21:19:14 +0530
committerTheDoctor314 <64731940+TheDoctor314@users.noreply.github.com>2022-02-08 21:19:14 +0530
commitadd80bccfc564e840b739bb8162d48faabb00db1 (patch)
treeb8eea1520be097e2a9e0c6cbcefcec2ea92d07fd
parent9b1978a3ed405c2a5ec34703914ec1878b599e14 (diff)
downloadrust-add80bccfc564e840b739bb8162d48faabb00db1.tar.gz
rust-add80bccfc564e840b739bb8162d48faabb00db1.zip
Add test
The rename function should not change any path segments that refer to a
module by super.
-rw-r--r--crates/ide/src/rename.rs25
1 files changed, 25 insertions, 0 deletions
diff --git a/crates/ide/src/rename.rs b/crates/ide/src/rename.rs
index f9f9c0832cd..971bcede5ac 100644
--- a/crates/ide/src/rename.rs
+++ b/crates/ide/src/rename.rs
@@ -1109,6 +1109,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]
     fn test_enum_variant_from_module_1() {
         cov_mark::check!(rename_non_local);
         check(