v2 / vlib / json / tests / json_decode_with_encode_arg_test.v
12 lines · 10 sloc · 182 bytes · 8ebbacecd60366ac4ba68aa35f9b0e7a0e56ff61
Raw
1import json
2
3struct TodoDto {
4 foo int
5}
6
7fn test_decode_with_encode_arg() {
8 body := TodoDto{}
9 ret := json.decode(TodoDto, json.encode(body))!
10 println(ret)
11 assert ret.foo == 0
12}
13