Pin the corpus page counts
The corpus guard only checked that each document produced at least one page. It now asserts the exact counts (hello 1, boxes 1, compat 1, arXiv template 2) alongside the empty warnings array, so a layout regression that drops or adds a page fails the server test even when no warning is emitted. The status document's verification paragraph mentions the exact-count check.
This commit is contained in:
1 parent
7fbcb326d5
commit
e8f7e37cf7
2 files changed
+14
-6
No files matched your search
+11
-3
@@ -2366,9 +2366,17 @@ fn corpus_documents_preview_without_warnings() {
|
||||
let value: Value = serde_json::from_slice(&response.body).expect("preview JSON");
|
||||
let warnings = value["warnings"].as_array().cloned().unwrap_or_default();
|
||||
assert!(warnings.is_empty(), "{relative}: {warnings:?}");
|
||||
assert!(
|
||||
value["pageCount"].as_u64().unwrap_or(0) >= 1,
|
||||
"{relative}: no pages"
|
||||
let expected_pages = match relative {
|
||||
"examples/hello.tex" => 1,
|
||||
"examples/boxes.tex" => 1,
|
||||
"examples/compat.tex" => 1,
|
||||
"fixtures/arxiv-template/template.tex" => 2,
|
||||
other => panic!("unexpected corpus document {other}"),
|
||||
};
|
||||
assert_eq!(
|
||||
value["pageCount"].as_u64(),
|
||||
Some(expected_pages),
|
||||
"{relative}: wrong page count"
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user