checker: fix json.encode_pretty with a struct init expression argument (#22897)

This commit is contained in:
Turiiya 2024-11-18 09:42:34 +01:00 committed by GitHub
parent 47c785886c
commit 3bf459c0d2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 9 additions and 2 deletions

View file

@ -461,6 +461,13 @@ fn test_omit_empty() {
// println(json.encode_pretty(foo))
}
fn test_encode_struct_expression() {
assert json.encode(Foo2{'Foo'}) == '{"name":"Foo"}'
assert json.encode_pretty(Foo2{'Bar'}) == '{
"name": "Bar"
}'
}
struct Asdasd {
data GamePacketData
}