Turn the nonmodrs-mods test into a standard idempotence test

We need to skip children on foo.rs, since the parser will not find bar from that
file, but with that, the test works fine.
This commit is contained in:
Florian Diebold
2018-05-06 13:03:11 +02:00
parent 215baae223
commit e65aa302d3
7 changed files with 11 additions and 23 deletions
-17
View File
@@ -232,23 +232,6 @@ fn self_tests() {
);
}
#[test]
fn issue_2673_non_modrs_mods() {
match idempotent_check(&PathBuf::from("tests/issue-2673-nonmodrs-mods/lib.rs")) {
Ok(ref report) if report.has_warnings() => {
print!("{}", report);
panic!("had warnings");
}
Ok(_report) => {}
Err(err) => {
if let IdempotentCheckError::Mismatch(msg) = err {
print_mismatches_default_message(msg);
}
panic!("had errors");
}
}
}
#[test]
fn stdin_formatting_smoke_test() {
let input = Input::Text("fn main () {}".to_owned());
+1
View File
@@ -0,0 +1 @@
skip_children = true
-3
View File
@@ -1,3 +0,0 @@
mod bar;
mod baz {}
-3
View File
@@ -1,3 +0,0 @@
#![feature(non_modrs_mods)]
mod foo;
@@ -0,0 +1,4 @@
// rustfmt-config: skip_children.toml
mod bar;
mod baz {}
@@ -0,0 +1,6 @@
#![feature(non_modrs_mods)]
// Test that submodules in non-mod.rs files work. This is just an idempotence
// test since we just want to verify that rustfmt doesn't fail.
mod foo;