Skip to content

Commit

Permalink
Cover all the Value variants in indented Debug test
Browse files Browse the repository at this point in the history
  • Loading branch information
dtolnay committed Aug 21, 2022
1 parent a047355 commit 0671603
Showing 1 changed file with 24 additions and 7 deletions.
31 changes: 24 additions & 7 deletions tests/debug.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,17 +53,34 @@ fn error() {

#[test]
fn indented() {
let j = json!({ "array": [0, 1] });
let j = json!({
"Null": null,
"Bool": true,
"Number": 1,
"String": "...",
"Array": [true],
"EmptyArray": [],
"EmptyObject": {}
});
let expected = indoc! {r#"
Object({
"array": Array([
Number(
0,
),
Number(
1,
"Array": Array([
Bool(
true,
),
]),
"Bool": Bool(
true,
),
"EmptyArray": Array([]),
"EmptyObject": Object({}),
"Null": Null,
"Number": Number(
1,
),
"String": String(
"...",
),
})"#
};
assert_eq!(format!("{:#?}", j), expected);
Expand Down

0 comments on commit 0671603

Please sign in to comment.