1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

json: add raw json test

This commit is contained in:
Danil-Lapirow 2019-08-22 14:22:16 +03:00 committed by Alexander Medvednikov
parent 77b31de117
commit fe8145c697

View File

@ -17,4 +17,17 @@ fn test_parse_user() {
assert u.nums[2] == 3 assert u.nums[2] == 3
} }
struct Color {
space string
point string [raw]
}
fn test_raw_json_field() {
color := json.decode(Color, '{"space": "YCbCr", "point": {"Y": 123}}') or {
println('text')
return
}
assert color.point == '{"Y":123}'
assert color.space == 'YCbCr'
}