mirror of
https://github.com/rust-lang/rust.git
synced 2026-04-28 03:07:24 +03:00
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:
@@ -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());
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
skip_children = true
|
||||
@@ -1,3 +0,0 @@
|
||||
mod bar;
|
||||
|
||||
mod baz {}
|
||||
@@ -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;
|
||||
Reference in New Issue
Block a user