molpopgen / demes-rs

rust tools for the demes ecosystem
MIT License
0 stars 1 forks source link

test: improve testing of JSON input #401

Closed molpopgen closed 1 month ago

molpopgen commented 1 month ago

Refactor the tests of valid spec cases to auto-convert from the input YAML to JSON using serde.

This change means that we are no longer relying on fully-resolved graphs for testing JSON input, which is an improvement. The previous implementation read in the YAML, output to JSON, and then recreated a graph from the JSON. Such an approach is somewhat circular and the JSON string represented a fully-resolved graph.

molpopgen commented 1 month ago

Note: the tests fail b/c JSON has no natural encoding for infinity. We have to do some kind of a hack to make tests pass or skip example test files from demes-spec that cannot pass on their own.