diff options
Diffstat (limited to 'crates/ra_ide_api/tests/test/main.rs')
-rw-r--r-- | crates/ra_ide_api/tests/test/main.rs | 20 |
1 files changed, 4 insertions, 16 deletions
diff --git a/crates/ra_ide_api/tests/test/main.rs b/crates/ra_ide_api/tests/test/main.rs index 7dc1dba73..2b863aedf 100644 --- a/crates/ra_ide_api/tests/test/main.rs +++ b/crates/ra_ide_api/tests/test/main.rs | |||
@@ -1,7 +1,6 @@ | |||
1 | mod runnables; | ||
2 | |||
3 | use ra_syntax::TextRange; | 1 | use ra_syntax::TextRange; |
4 | use test_utils::{assert_eq_dbg, assert_eq_text}; | 2 | use test_utils::assert_eq_text; |
3 | use insta::assert_debug_snapshot_matches; | ||
5 | 4 | ||
6 | use ra_ide_api::{ | 5 | use ra_ide_api::{ |
7 | mock_analysis::{single_file, single_file_with_position, MockAnalysis}, | 6 | mock_analysis::{single_file, single_file_with_position, MockAnalysis}, |
@@ -12,18 +11,7 @@ use ra_ide_api::{ | |||
12 | fn test_unresolved_module_diagnostic() { | 11 | fn test_unresolved_module_diagnostic() { |
13 | let (analysis, file_id) = single_file("mod foo;"); | 12 | let (analysis, file_id) = single_file("mod foo;"); |
14 | let diagnostics = analysis.diagnostics(file_id).unwrap(); | 13 | let diagnostics = analysis.diagnostics(file_id).unwrap(); |
15 | assert_eq_dbg( | 14 | assert_debug_snapshot_matches!("unresolved_module_diagnostic", &diagnostics); |
16 | r#"[Diagnostic { | ||
17 | message: "unresolved module", | ||
18 | range: [4; 7), | ||
19 | fix: Some(SourceChange { | ||
20 | label: "create module", | ||
21 | source_file_edits: [], | ||
22 | file_system_edits: [CreateFile { source_root: SourceRootId(0), path: "foo.rs" }], | ||
23 | cursor_position: None }), | ||
24 | severity: Error }]"#, | ||
25 | &diagnostics, | ||
26 | ); | ||
27 | } | 15 | } |
28 | 16 | ||
29 | // FIXME: move this test to hir | 17 | // FIXME: move this test to hir |
@@ -31,7 +19,7 @@ fn test_unresolved_module_diagnostic() { | |||
31 | fn test_unresolved_module_diagnostic_no_diag_for_inline_mode() { | 19 | fn test_unresolved_module_diagnostic_no_diag_for_inline_mode() { |
32 | let (analysis, file_id) = single_file("mod foo {}"); | 20 | let (analysis, file_id) = single_file("mod foo {}"); |
33 | let diagnostics = analysis.diagnostics(file_id).unwrap(); | 21 | let diagnostics = analysis.diagnostics(file_id).unwrap(); |
34 | assert_eq_dbg(r#"[]"#, &diagnostics); | 22 | assert!(diagnostics.is_empty()); |
35 | } | 23 | } |
36 | 24 | ||
37 | #[test] | 25 | #[test] |