Skip to content

Commit

Permalink
Additional tests for JSON ver
Browse files Browse the repository at this point in the history
Add more tests around decoding the grid version.
  • Loading branch information
rracariu committed Sep 30, 2022
1 parent 18a4506 commit 3e3ff2d
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions tests/json/test_grid.rs
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,8 @@ fn test_json_grid_with_ver() {
Grid::make_from_dicts_with_meta(recs.clone(), Dict::default()).into()
);

assert!(matches!(value, Value::Grid(grid) if grid.ver == GRID_FORMAT_VERSION));

let string = concat!(
r#"{"_kind":"grid","meta":{"ver": "3.0", "foo": 100},"#,
r#""cols":[{"name":"dis"}],"#,
Expand All @@ -139,6 +141,7 @@ fn test_json_grid_with_ver() {
);
let value: Value = serde_json::from_str(string).expect("Value");

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

Expand Down

0 comments on commit 3e3ff2d

Please sign in to comment.