Cover all the Value variants in indented Debug test

This commit is contained in:
David Tolnay 2022-08-21 12:59:04 -07:00
parent a047355bcd
commit 0671603282
No known key found for this signature in database
GPG Key ID: F9BA143B95FF6D82

View File

@ -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);