From 7054e89d187287c0547ef43961bf4969aba57dd6 Mon Sep 17 00:00:00 2001 From: Jonas Schievink Date: Mon, 15 Jun 2020 19:16:29 +0200 Subject: Fix test --- crates/ra_hir_def/src/item_tree.rs | 6 +++++- crates/ra_hir_def/src/nameres/tests/mod_resolution.rs | 7 +++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/crates/ra_hir_def/src/item_tree.rs b/crates/ra_hir_def/src/item_tree.rs index 71b415802..245ee5e62 100644 --- a/crates/ra_hir_def/src/item_tree.rs +++ b/crates/ra_hir_def/src/item_tree.rs @@ -8,6 +8,7 @@ use hir_expand::{ }; use ra_arena::{Arena, Idx, RawId}; use ra_syntax::{ast, match_ast}; +use test_utils::mark; use crate::{ attr::Attrs, @@ -693,7 +694,10 @@ impl Ctx { .flat_map(|items| items.0) .collect() }) - .unwrap_or_default(), + .unwrap_or_else(|| { + mark::hit!(name_res_works_for_broken_modules); + Vec::new() + }), } }; let ast_id = self.source_ast_id_map.ast_id(module); diff --git a/crates/ra_hir_def/src/nameres/tests/mod_resolution.rs b/crates/ra_hir_def/src/nameres/tests/mod_resolution.rs index b43b294ca..d42933eed 100644 --- a/crates/ra_hir_def/src/nameres/tests/mod_resolution.rs +++ b/crates/ra_hir_def/src/nameres/tests/mod_resolution.rs @@ -20,8 +20,11 @@ fn name_res_works_for_broken_modules() { ", ); assert_snapshot!(map, @r###" - ⋮crate - ⋮Baz: _ +crate +Baz: _ +foo: t + +crate::foo "###); } -- cgit v1.2.3