diff --git a/.needle-predispatch-sha b/.needle-predispatch-sha index 2e7f39a..7b0239a 100644 --- a/.needle-predispatch-sha +++ b/.needle-predispatch-sha @@ -1 +1 @@ -746309b8df093fe1835c8555d2f807dc09d1fe08 +d0f52751ce026908d8bf3ab61aaae40cb94d4735 diff --git a/crates/pdftract-cli/src/inspect/render/mcid.rs b/crates/pdftract-cli/src/inspect/render/mcid.rs index 3ba5a97..c2b0e78 100644 --- a/crates/pdftract-cli/src/inspect/render/mcid.rs +++ b/crates/pdftract-cli/src/inspect/render/mcid.rs @@ -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] diff --git a/crates/pdftract-cli/src/inspect/render/ocr_regions.rs b/crates/pdftract-cli/src/inspect/render/ocr_regions.rs index 23b1091..b84c98e 100644 --- a/crates/pdftract-cli/src/inspect/render/ocr_regions.rs +++ b/crates/pdftract-cli/src/inspect/render/ocr_regions.rs @@ -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""#)); diff --git a/crates/pdftract-cli/src/serve.rs b/crates/pdftract-cli/src/serve.rs index 884e337..0254510 100644 --- a/crates/pdftract-cli/src/serve.rs +++ b/crates/pdftract-cli/src/serve.rs @@ -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")); diff --git a/notes/pdftract-39gey.md b/notes/pdftract-39gey.md index b3d3740..bfea3a0 100644 --- a/notes/pdftract-39gey.md +++ b/notes/pdftract-39gey.md @@ -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