json: add raw json test
parent
77b31de117
commit
fe8145c697
|
@ -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'
|
||||||
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue