diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2020-11-03 16:36:34 +0000 |
---|---|---|
committer | GitHub <[email protected]> | 2020-11-03 16:36:34 +0000 |
commit | 8ad01d863bd747f194ac391ba6fcb950c78e3ea3 (patch) | |
tree | 88807a5b4349d05fcf2aed8877e5f641cc4b52f6 /crates/hir_def/src/nameres/tests | |
parent | 0373434ed4a0db418edad0c4393acf28adc48ef1 (diff) | |
parent | ff87726074915fe298cb37ca60b193f922a612df (diff) |
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]>
Diffstat (limited to 'crates/hir_def/src/nameres/tests')
-rw-r--r-- | crates/hir_def/src/nameres/tests/mod_resolution.rs | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/crates/hir_def/src/nameres/tests/mod_resolution.rs b/crates/hir_def/src/nameres/tests/mod_resolution.rs index f93337a6e..ec9d589a3 100644 --- a/crates/hir_def/src/nameres/tests/mod_resolution.rs +++ b/crates/hir_def/src/nameres/tests/mod_resolution.rs | |||
@@ -323,13 +323,26 @@ pub struct Baz; | |||
323 | fn module_resolution_relative_path_outside_root() { | 323 | fn module_resolution_relative_path_outside_root() { |
324 | check( | 324 | check( |
325 | r#" | 325 | r#" |
326 | //- /main.rs | 326 | //- /a/b/c/d/e/main.rs crate:main |
327 | #[path="../../../../../outside.rs"] | 327 | #[path="../../../../../outside.rs"] |
328 | mod foo; | 328 | mod foo; |
329 | |||
330 | //- /outside.rs | ||
331 | mod bar; | ||
332 | |||
333 | //- /bar.rs | ||
334 | pub struct Baz; | ||
329 | "#, | 335 | "#, |
330 | expect![[r#" | 336 | expect![[r#" |
331 | crate | 337 | crate |
332 | "#]], | 338 | foo: t |
339 | |||
340 | crate::foo | ||
341 | bar: t | ||
342 | |||
343 | crate::foo::bar | ||
344 | Baz: t v | ||
345 | "#]], | ||
333 | ); | 346 | ); |
334 | } | 347 | } |
335 | 348 | ||