Skip to content

Commit baae6d9

Browse files
committed
Add test for {:#?} format of Value
1 parent 800a8d5 commit baae6d9

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

tests/debug.rs

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,3 +49,24 @@ fn error() {
4949
let expected = "Error(\"key must be a string\", line: 1, column: 2)";
5050
assert_eq!(format!("{:?}", err), expected);
5151
}
52+
53+
const INDENTED_EXPECTED: &str = r#"Object(
54+
{
55+
"array": Array(
56+
[
57+
Number(
58+
0,
59+
),
60+
Number(
61+
1,
62+
),
63+
],
64+
),
65+
},
66+
)"#;
67+
68+
#[test]
69+
fn indented() {
70+
let j = json!({ "array": [0, 1] });
71+
assert_eq!(format!("{:#?}", j), INDENTED_EXPECTED);
72+
}

0 commit comments

Comments
 (0)