Skip to content

Commit 8ad01d8

Browse files
Merge #6435
6435: Test Fixture ExplicitRoot + ModuleResolutionRelativePathOutsideRoot. r=matklad a=rickvanprim Updates `module_resolution_relative_path_outside_root` test to check valid paths outside of the root, by moving the root to a subpath so that paths outside of it are possible. If this would be more appropriate as a new test, or if the original check for an invalid path should be left, I'm happy to update. Co-authored-by: James Leitch <[email protected]>
2 parents 0373434 + ff87726 commit 8ad01d8

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

crates/hir_def/src/nameres/tests/mod_resolution.rs

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -323,13 +323,26 @@ pub struct Baz;
323323
fn module_resolution_relative_path_outside_root() {
324324
check(
325325
r#"
326-
//- /main.rs
326+
//- /a/b/c/d/e/main.rs crate:main
327327
#[path="../../../../../outside.rs"]
328328
mod foo;
329+
330+
//- /outside.rs
331+
mod bar;
332+
333+
//- /bar.rs
334+
pub struct Baz;
329335
"#,
330336
expect![[r#"
331337
crate
332-
"#]],
338+
foo: t
339+
340+
crate::foo
341+
bar: t
342+
343+
crate::foo::bar
344+
Baz: t v
345+
"#]],
333346
);
334347
}
335348

0 commit comments

Comments
 (0)