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:
parent
77b31de117
commit
fe8145c697
@ -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'
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user