test(pdftract-39gey): fix test assertions for string escaping and hyper API updates
- Fix raw string literal escaping in mcid.rs and ocr_regions.rs tests - Update serve.rs tests for http_body_util and tower APIs - Update verification note to reflect indent trigger fix All changes are test infrastructure related to Phase 4.4 Block Formation.
This commit is contained in:
parent
d0f52751ce
commit
198016d1ef
5 changed files with 13 additions and 11 deletions
|
|
@ -1 +1 @@
|
|||
746309b8df093fe1835c8555d2f807dc09d1fe08
|
||||
d0f52751ce026908d8bf3ab61aaae40cb94d4735
|
||||
|
|
|
|||
|
|
@ -296,7 +296,7 @@ mod tests {
|
|||
|
||||
let result = render_mcid_labels(&Some(mcid_map), &blocks);
|
||||
// Check for the amber/orange color (#f59e0b)
|
||||
assert!(result[0].contains(r#"fill="#f59e0b""#));
|
||||
assert!(result[0].contains(r##"fill="#f59e0b""##));
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
|
|
|||
|
|
@ -193,9 +193,9 @@ mod tests {
|
|||
assert!(rect.contains(r#"fill="url(#ocr-diagonal-stripes)""#));
|
||||
|
||||
// Check stroke
|
||||
assert!(rect.contains(r#"stroke="#00d9ff""#));
|
||||
assert!(rect.contains(r#"stroke-width="1""#));
|
||||
assert!(rect.contains(r#"stroke-opacity="0.5""#));
|
||||
assert!(rect.contains(r##"stroke="#00d9ff""##));
|
||||
assert!(rect.contains(r##"stroke-width="1""##));
|
||||
assert!(rect.contains(r##"stroke-opacity="0.5""##));
|
||||
|
||||
// Check data attributes
|
||||
assert!(rect.contains(r#"data-ocr-source="ocr""#));
|
||||
|
|
|
|||
|
|
@ -1092,7 +1092,7 @@ impl IntoResponse for AxumError {
|
|||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
use hyper::body::to_bytes;
|
||||
use http_body_util::BodyExt;
|
||||
use std::time::Duration;
|
||||
|
||||
/// Test that the AxumError enum converts to correct status codes and error codes.
|
||||
|
|
@ -1148,7 +1148,7 @@ mod tests {
|
|||
let resp = err.into_response();
|
||||
assert_eq!(resp.status(), StatusCode::UNPROCESSABLE_ENTITY);
|
||||
// Verify the response body contains DECOMPRESSION_LIMIT error code
|
||||
let body = hyper::body::to_bytes(resp.into_body()).await.unwrap();
|
||||
let body = resp.into_body().collect().await.unwrap().to_bytes();
|
||||
let json: serde_json::Value = serde_json::from_slice(&body).unwrap();
|
||||
assert_eq!(json["error"], "DECOMPRESSION_LIMIT");
|
||||
assert!(json["hint"].as_str().unwrap().contains("zip-bomb"));
|
||||
|
|
@ -1161,6 +1161,7 @@ mod tests {
|
|||
body::Body,
|
||||
http::{StatusCode, Request},
|
||||
};
|
||||
use tower::ServiceExt;
|
||||
|
||||
let state = ServeState::new(None, 1024 * 1024 * 1024, true, None, 1 << 30, false);
|
||||
let app = Router::new()
|
||||
|
|
@ -1173,14 +1174,14 @@ mod tests {
|
|||
.method("GET")
|
||||
.body(Body::empty())
|
||||
.unwrap();
|
||||
let response = axum::app::clone_app(&app)
|
||||
let response = app
|
||||
.oneshot(request)
|
||||
.await
|
||||
.unwrap();
|
||||
assert_eq!(response.status(), StatusCode::NOT_FOUND);
|
||||
|
||||
// Verify the error message is descriptive
|
||||
let body = hyper::body::to_bytes(response.into_body()).await.unwrap();
|
||||
let body = response.into_body().collect().await.unwrap().to_bytes();
|
||||
let json: serde_json::Value = serde_json::from_slice(&body).unwrap();
|
||||
assert_eq!(json["error"], "NOT_FOUND");
|
||||
assert!(json["message"].as_str().unwrap().contains("POST"));
|
||||
|
|
|
|||
|
|
@ -27,8 +27,9 @@ Coordinator for Phase 4.4 Block Formation. All 8 child beads completed and verif
|
|||
|
||||
2. **Indented first line of paragraph: NOT split unconditionally** ✅
|
||||
- Verified in pdftract-fy89c acceptance criteria
|
||||
- Test `test_indented_first_line_new_block`: indent > 0.03 * column_width creates new block
|
||||
- This is correct behavior per plan (line 1696)
|
||||
- Test `test_indented_first_line_of_paragraph_not_split`: drop-cap style (first line indented, rest flush) stays together
|
||||
- Commit `d0f52751`: fix indent trigger to not split drop-cap paragraphs
|
||||
- Indent trigger only fires when current line x0 > block avg x0 (not on first line)
|
||||
|
||||
3. **Header text on pages 1-10 with identical text: classified Header, deduplicated** ✅
|
||||
- Verified in pdftract-2j4zl acceptance criteria
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue