Fix assert test reflow form: cum tu tim kiem vat qua cho be dong - so khop tren ban chuan hoa khoang trang (chuc nang reflow da chay dung, extract ra 6 dong)
Build Windows portable / build (push) Canceled after 0s

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
2026-08-08 02:32:21 +07:00
co-authored by Claude Fable 5
parent d4b09e0ed8
commit 8c6a819aa8
+4 -2
View File
@@ -1171,8 +1171,10 @@ fn form_xobject_reflow_after_flatten_roundtrip() {
.expect("apply_edits ReflowText sau flatten");
let text = ff_engine::extract_text(&pdf, &out, 0, None).expect("extract");
assert!(text.contains("Đoạn văn tiếng Việt thay thế"), "text mới phải có mặt: {text:?}");
assert!(!text.contains("Hello inside form"), "text cũ phải biến mất: {text:?}");
// Reflow bẻ dòng ở giữa cụm từ → so khớp trên bản CHUẨN HOÁ khoảng trắng.
let norm = text.split_whitespace().collect::<Vec<_>>().join(" ");
assert!(norm.contains("Đoạn văn tiếng Việt thay thế"), "text mới phải có mặt: {text:?}");
assert!(!norm.contains("Hello inside form"), "text cũ phải biến mất: {text:?}");
let objs = ff_engine::list_objects(&pdf, &out, 0, None).expect("list out");
let new_runs: Vec<_> = objs
.iter()