From aaca7d003bd969785be53d8f312b67bfa26f6272 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Mon, 27 Aug 2018 20:58:38 +0300 Subject: move scopes to file --- crates/libanalysis/tests/tests.rs | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'crates/libanalysis/tests') diff --git a/crates/libanalysis/tests/tests.rs b/crates/libanalysis/tests/tests.rs index 32abf9152..b3c357b02 100644 --- a/crates/libanalysis/tests/tests.rs +++ b/crates/libanalysis/tests/tests.rs @@ -44,6 +44,19 @@ fn test_resolve_module() { ); } +#[test] +fn test_unresolved_module_diagnostic() { + let mut world = WorldState::new(); + world.change_file(FileId(1), Some("mod foo;".to_string())); + + let snap = world.snapshot(|_id, _path| None); + let diagnostics = snap.diagnostics(FileId(1)).unwrap(); + assert_eq_dbg( + r#"[Diagnostic { range: [4; 7), msg: "unresolved module" }]"#, + &diagnostics, + ); +} + #[test] fn test_resolve_parent_module() { let mut world = WorldState::new(); -- cgit v1.2.3