From 9ea2c96ddd0ad8c8898f1c65667a57a78ba2218c Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Tue, 9 Feb 2021 18:29:15 +0300 Subject: restore accidentally deleted test --- crates/ide/src/parent_module.rs | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/crates/ide/src/parent_module.rs b/crates/ide/src/parent_module.rs index 7b08bc27b..ddbaf22b7 100644 --- a/crates/ide/src/parent_module.rs +++ b/crates/ide/src/parent_module.rs @@ -120,4 +120,17 @@ mod foo { "#, ); } + + #[test] + fn test_resolve_crate_root() { + let (analysis, file_id) = fixture::file( + r#" +//- /main.rs +mod foo; +//- /foo.rs +$0 +"#, + ); + assert_eq!(analysis.crate_for(file_id).unwrap().len(), 1); + } } -- cgit v1.2.3