Skip to content

Commit 3e3ff2d

Browse files
committed
Additional tests for JSON ver
Add more tests around decoding the grid version.
1 parent 18a4506 commit 3e3ff2d

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

tests/json/test_grid.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,8 @@ fn test_json_grid_with_ver() {
120120
Grid::make_from_dicts_with_meta(recs.clone(), Dict::default()).into()
121121
);
122122

123+
assert!(matches!(value, Value::Grid(grid) if grid.ver == GRID_FORMAT_VERSION));
124+
123125
let string = concat!(
124126
r#"{"_kind":"grid","meta":{"ver": "3.0", "foo": 100},"#,
125127
r#""cols":[{"name":"dis"}],"#,
@@ -139,6 +141,7 @@ fn test_json_grid_with_ver() {
139141
);
140142
let value: Value = serde_json::from_str(string).expect("Value");
141143

144+
assert!(matches!(&value, Value::Grid(grid) if grid.ver == "2.0"));
142145
assert_ne!(value, Grid::make_from_dicts(recs).into())
143146
}
144147

0 commit comments

Comments
 (0)