diff options
author | Aleksey Kladov <[email protected]> | 2018-08-27 18:58:38 +0100 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2018-08-27 18:58:38 +0100 |
commit | aaca7d003bd969785be53d8f312b67bfa26f6272 (patch) | |
tree | 9e3ab4d75d631fb1055fb6ab5c05f0a78153fadd /crates/libanalysis/tests | |
parent | 846114a6e95da696deb6a0f3243ad23c45074a00 (diff) |
move scopes to file
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())); |