mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
x.json2: add json2.map_from(t T) (#16797)
This commit is contained in:
@ -73,7 +73,7 @@ fn test_types() {
|
||||
assert json.decode[StructType[int]]('{"val": 0}')!.val == 0
|
||||
assert json.decode[StructType[int]]('{"val": 1}')!.val == 1
|
||||
assert json.decode[StructType[int]]('{"val": 2}')!.val == 2
|
||||
assert json.decode[StructType[int]]('{"val": "true"}')!.val == 1
|
||||
assert json.decode[StructType[int]]('{"val": "true"}')!.val == 0
|
||||
assert json.decode[StructType[int]]('{"val": "false"}')!.val == 0
|
||||
assert json.decode[StructType[int]]('{"val": true}')!.val == 1
|
||||
assert json.decode[StructType[int]]('{"val": false}')!.val == 0
|
||||
|
Reference in New Issue
Block a user