Add formatter test for escaped characters

This commit is contained in:
Gregory Schier
2024-10-22 08:11:03 -07:00
parent 57a05d5486
commit 44fc3c8d2d

View File

@@ -151,6 +151,19 @@ mod test {
);
}
#[test]
fn test_escaped() {
assert_eq!(
format_json(r#"{"foo":"Hi \"world!\""}"#, " "),
r#"
{
"foo": "Hi \"world!\""
}
"#
.trim()
);
}
#[test]
fn test_simple_array() {
assert_eq!(
@@ -219,7 +232,7 @@ mod test {
.trim()
);
}
#[test]
fn test_graphql_response() {
assert_eq!(