Gitly
English
Русский
Español
日本語
中文
Português
Log in
Register
v
/
vlib
/
json
/
tests
/
json_decode_option_alias_field_test.v
16
lines
·
12
sloc
·
208 bytes
·
57aae3fd20e98f3efe67102fdf375bfcf0835f0d
Raw
1
module
main
2
3
import
json
4
5
struct
Req {
6
height ?int
7
width ?i32
8
}
9
10
const
payload =
'{}'
11
12
fn
test_main() {
13
r := json.decode(Req, payload)
or
{ panic(err) }
14
assert r.height ==
none
15
assert r.width ==
none
16
}
17