v/vlib/json/json_i32_test.v
2024-04-02 05:24:36 +03:00

17 lines
281 B
V

import json
pub struct StructB {
kind string
value i32
}
fn test_json_i32() {
struct_b := json.decode(StructB, '{"kind": "Int32", "value": 100}')!
assert struct_b == StructB{
kind: 'Int32'
value: 100
}
assert json.encode(struct_b) == '{"kind":"Int32","value":100}'
}