Tests: the io crate's hand-built saved models list their rounds, as format 7 records do

Model cache format 7 (f3cf0c4f3) records a `rounds` list in every saved model, and reading one
without it is refused ("saved model: rounds"), as is a model without any of its other lists:
the states, the preview and the thinned model all came back empty. The io tests' saved_model
and timeline_model wrote format-6 records, so six tests (the round trip, the repeated part
stored once, and the four too-big-for-the-file cases) read nothing. Their bodies are none made
by rounds: the list is empty, and every expectation stays as it was.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
jyviko
2026-10-30 19:36:28 -04:00
committed by jyviko
parent 134a34f895
commit 456e5b7fa5
+4 -3
View File
@@ -968,8 +968,8 @@ mod tests {
assert!(result.is_err_and(|e| e.to_string().contains("not a regular file")));
}
/// A saved model of one state holding `bodies` (no document evaluated it: enough for the
/// container, which stores whatever model it is given).
/// A saved model of one state holding `bodies`, none made by rounds (no document evaluated
/// it: enough for the container, which stores whatever model it is given).
fn saved_model(bodies: Vec<solidcraft_kernel::Body>) -> solidcraft_doc::SavedModel {
let records: Vec<Value> = (0..bodies.len())
.map(|i| json!({"name": format!("Body{i}"), "feature": 1, "component": 0, "key": "0000000000000001", "names": 0, "body": i}))
@@ -982,6 +982,7 @@ mod tests {
records: json!({
"features": [{"id": 1, "fingerprint": "0000000000000000", "ms": 0.0, "skipped": false, "state": 0}],
"states": [state], "model_bodies": records, "names": [{"faces": [], "info": []}], "sketches": [], "sheets": [],
"rounds": [],
}),
bodies,
}
@@ -1089,7 +1090,7 @@ mod tests {
solidcraft_doc::SavedModel {
records: json!({
"features": features, "states": states, "model_bodies": records, "names": [{"faces": [], "info": []}], "sketches": [],
"sheets": [], "validation": "each_feature",
"sheets": [], "validation": "each_feature", "rounds": [],
}),
bodies,
}