Skip to content

Commit

Permalink
Rust ./x.py fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
richard-uk1 committed Jan 16, 2020
1 parent 9864ec4 commit 73124df
Showing 1 changed file with 14 additions and 12 deletions.
26 changes: 14 additions & 12 deletions src/libcore/tests/fmt/builders.rs
Original file line number Diff line number Diff line change
Expand Up @@ -100,18 +100,17 @@ mod debug_struct {

impl fmt::Debug for Foo {
fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result {
fmt.debug_struct("Foo")
.finish_non_exhaustive()
fmt.debug_struct("Foo").finish_non_exhaustive()
}
}


assert_eq!("Foo { .. }", format!("{:?}", Foo));
assert_eq!(
"Foo {
"Foo {
..
}",
format!("{:#?}", Foo));
format!("{:#?}", Foo)
);
}

#[test]
Expand All @@ -129,12 +128,13 @@ mod debug_struct {

assert_eq!("Foo { bar: true, baz: 10/20, .. }", format!("{:?}", Foo));
assert_eq!(
"Foo {
"Foo {
bar: true,
baz: 10/20,
..
}",
format!("{:#?}", Foo));
format!("{:#?}", Foo)
);
}

#[test]
Expand All @@ -161,10 +161,12 @@ mod debug_struct {
}
}

assert_eq!("Bar { foo: Foo { bar: true, baz: 10/20, .. }, hello: \"world\", .. }",
format!("{:?}", Bar));
assert_eq!(
"Bar {
"Bar { foo: Foo { bar: true, baz: 10/20, .. }, hello: \"world\", .. }",
format!("{:?}", Bar)
);
assert_eq!(
"Bar {
foo: Foo {
bar: true,
baz: 10/20,
Expand All @@ -173,9 +175,9 @@ mod debug_struct {
hello: \"world\",
..
}",
format!("{:#?}", Bar));
format!("{:#?}", Bar)
);
}

}

mod debug_tuple {
Expand Down

0 comments on commit 73124df

Please sign in to comment.