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 <rickvanprim@gmail.com>
This commit is contained in:
bors[bot] 2020-11-03 16:36:34 +00:00 committed by GitHub
commit 8ad01d863b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -323,13 +323,26 @@ pub struct Baz;
fn module_resolution_relative_path_outside_root() {
check(
r#"
//- /main.rs
//- /a/b/c/d/e/main.rs crate:main
#[path="../../../../../outside.rs"]
mod foo;
//- /outside.rs
mod bar;
//- /bar.rs
pub struct Baz;
"#,
expect![[r#"
crate
"#]],
foo: t
crate::foo
bar: t
crate::foo::bar
Baz: t v
"#]],
);
}