move tests to where they belong

This commit is contained in:
Aleksey Kladov 2019-03-25 14:28:04 +03:00
parent e9af69d9db
commit 309716cffe
4 changed files with 32 additions and 44 deletions

View file

@ -152,6 +152,9 @@ fn check_struct_shorthand_initialization(
#[cfg(test)]
mod tests {
use test_utils::assert_eq_text;
use insta::assert_debug_snapshot_matches;
use crate::mock_analysis::single_file;
use super::*;
@ -180,6 +183,34 @@ mod tests {
assert_eq_text!(after, &actual);
}
#[test]
fn test_unresolved_module_diagnostic() {
let (analysis, file_id) = single_file("mod foo;");
let diagnostics = analysis.diagnostics(file_id).unwrap();
assert_debug_snapshot_matches!(diagnostics, @r####"[
Diagnostic {
message: "unresolved module",
range: [0; 8),
fix: Some(
SourceChange {
label: "create module",
source_file_edits: [],
file_system_edits: [
CreateFile {
source_root: SourceRootId(
0
),
path: "foo.rs"
}
],
cursor_position: None
}
),
severity: Error
}
]"####);
}
#[test]
fn test_check_unnecessary_braces_in_use_statement() {
check_not_applicable(