From b00a4d43ecd4af49a2870718a9d5b8d49084a285 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Tue, 28 Aug 2018 20:29:36 +0300 Subject: Dont diagnose inline mods --- crates/libanalysis/tests/tests.rs | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'crates/libanalysis/tests/tests.rs') diff --git a/crates/libanalysis/tests/tests.rs b/crates/libanalysis/tests/tests.rs index e378ab986..e05aa8895 100644 --- a/crates/libanalysis/tests/tests.rs +++ b/crates/libanalysis/tests/tests.rs @@ -78,6 +78,19 @@ fn test_unresolved_module_diagnostic() { ); } +#[test] +fn test_unresolved_module_diagnostic_no_diag_for_inline_mode() { + let mut world = WorldState::new(); + world.change_file(FileId(1), Some("mod foo {}".to_string())); + + let snap = world.snapshot(FileMap(&[(1, "/lib.rs")])); + let diagnostics = snap.diagnostics(FileId(1)).unwrap(); + assert_eq_dbg( + r#"[]"#, + &diagnostics, + ); +} + #[test] fn test_resolve_parent_module() { let mut world = WorldState::new(); -- cgit v1.2.3