json: add raw json test

pull/1710/head
Danil-Lapirow 2019-08-22 14:22:16 +03:00 committed by Alexander Medvednikov
parent 77b31de117
commit fe8145c697
1 changed files with 13 additions and 0 deletions

View File

@ -17,4 +17,17 @@ fn test_parse_user() {
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'
}