diff --git a/crates/core/tests/pdf_serialize.rs b/crates/core/tests/pdf_serialize.rs index 2d7f416d..5b096374 100644 --- a/crates/core/tests/pdf_serialize.rs +++ b/crates/core/tests/pdf_serialize.rs @@ -781,15 +781,13 @@ fn export_side_security_cases_hold() { ); let text = String::from_utf8_lossy(&stub_run("demo", "fr", "logos").r4).into_owned(); assert!(!text.contains("/URI ("), "URIs are written as hex strings"); - assert!( - text.contains(&format!( + assert!(text.contains(&format!( "/URI <{}>", "https://faunosteo.com" .bytes() .map(|b| format!("{b:02x}")) .collect::() - )) - ); + ))); // A refused PNG logo: the slot fails alone, the export completes with the warning. let mut bad_logo = envelope.clone(); bad_logo["branding"]["headerLogo"] = json!({ "kind": "png", "base64": "iVBORw0KGgo=" }); @@ -804,3 +802,32 @@ fn export_side_security_cases_hold() { ); assert!(read_attached_document(&result.pdf, ProbeLimits::PRODUCTION).is_ok()); } + +/// The writer's own cost on the L report with a real 1200 × 943 raster for every view (what +/// the browser produces), printed for RUST.md §10.7: the one-shot proofs export measured in +/// Node adds its JSON and base64 copies on top of this. 5 s in release, 40 s in debug, so +/// it runs on request: `cargo test --release … --test pdf_serialize -- --ignored`. +#[test] +#[ignore = "release-only timing (40 s in debug)"] +fn l_report_with_real_rasters_costs_what_it_costs() { + let r3 = fixture("pdf/r3/demo.fr.logos.pdf"); + let mut input = input_from(&envelope_of(&r3)); + let text = + std::fs::read_to_string(repo_root().join("apps/app/tests/fixtures/r4/reports/L.json")) + .unwrap(); + let mut report: faunosteo_core::domain::report::Report = + serde_json::from_value(parse_json(&text).unwrap()).unwrap(); + report.sheet = input.report.sheet.clone(); + input.report = report; + let raster = fixture("pdf/r3/real/raster-1.png"); + let rasters = stub_rasters(&input, &raster); + let started = std::time::Instant::now(); + let result = export_pdf(input, &rasters).unwrap(); + let ms = started.elapsed().as_millis(); + println!( + "L with real rasters: {} views, pdf {} bytes, {ms} ms (export incl. self-check)", + rasters.views.len(), + result.pdf.len() + ); + assert!(result.warnings.is_empty()); +}