mirror of
https://github.com/vlang/v.git
synced 2025-09-13 14:32:26 +03:00
checker: fix json.encode_pretty
with a struct init expression argument (#22897)
This commit is contained in:
parent
47c785886c
commit
3bf459c0d2
2 changed files with 9 additions and 2 deletions
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue