Integration: #2532 save the structure-tree test without object streams

The default save packs annotation dictionaries into compressed object
streams, so the URL and comment-text byte checks passed without the fix.
This commit is contained in:
aiongg
2026-10-16 14:02:18 +00:00
parent 9477e2a3fd
commit 53b8fda93f
+1 -1
View File
@@ -661,7 +661,7 @@ fn removed_links_and_comments_leave_the_structure_tree_and_the_saved_file() {
let mut doc = pdf(objs);
let done = remove_hidden(&mut doc, &[Hidden::LinksActionsScripts, Hidden::Comments]).unwrap();
assert!(done.contains(&(Hidden::LinksActionsScripts, 1)) && done.contains(&(Hidden::Comments, 1)), "{done:?}");
let bytes = write_full(&doc, &SaveOptions::default()).unwrap();
let bytes = write_full(&doc, &SaveOptions { object_streams: false, ..SaveOptions::default() }).unwrap();
let has = |needle: &[u8]| bytes.windows(needle.len()).any(|w| w == needle);
assert!(!has(b"secret.example"), "the removed link's URL survived the save");
assert!(!has(b"COMMENTSECRETNOTE"), "the removed comment's text survived the save");