diff options
Diffstat (limited to 'crates/libanalysis/tests')
-rw-r--r-- | crates/libanalysis/tests/tests.rs | 13 |
1 files changed, 13 insertions, 0 deletions
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 | |||
@@ -45,6 +45,19 @@ fn test_resolve_module() { | |||
45 | } | 45 | } |
46 | 46 | ||
47 | #[test] | 47 | #[test] |
48 | fn test_unresolved_module_diagnostic() { | ||
49 | let mut world = WorldState::new(); | ||
50 | world.change_file(FileId(1), Some("mod foo;".to_string())); | ||
51 | |||
52 | let snap = world.snapshot(|_id, _path| None); | ||
53 | let diagnostics = snap.diagnostics(FileId(1)).unwrap(); | ||
54 | assert_eq_dbg( | ||
55 | r#"[Diagnostic { range: [4; 7), msg: "unresolved module" }]"#, | ||
56 | &diagnostics, | ||
57 | ); | ||
58 | } | ||
59 | |||
60 | #[test] | ||
48 | fn test_resolve_parent_module() { | 61 | fn test_resolve_parent_module() { |
49 | let mut world = WorldState::new(); | 62 | let mut world = WorldState::new(); |
50 | world.change_file(FileId(1), Some("mod foo;".to_string())); | 63 | world.change_file(FileId(1), Some("mod foo;".to_string())); |