mirror of
https://github.com/storytold/pdfcraft.git
synced 2026-11-09 12:32:52 +00:00
M1: the sign discovery test reads a stream with neither endstream nor /Length as unreadable
With hayro-syntax patch 36 and its cos counterpart, a stream with no endstream left in the file is the bytes its /Length gives, so the fixture's `<< /Length 0 >>` stream without endstream now reads as an empty stream. The test needs an object that cannot be read: a stream with no /Length either still is one. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Pq7HyDBXygTf7jcqdsjcfn
This commit is contained in:
1 parent
12cb7c5ce1
commit
1a8922203d
1 file changed
+3
-2
@@ -172,8 +172,9 @@ fn reconstructed_and_unreadable_objects_are_not_cached_as_complete() {
|
||||
assert_eq!(cache.timestamp_candidates(&repaired), vec![ObjRef::new(3, 0)]);
|
||||
}
|
||||
// A single invalid keyword immediately before endobj is deliberately recovered as
|
||||
// Null by parse_indirect. Use a stream without endstream to exercise a real read error.
|
||||
let unreadable = fixture(&[STAMP, "<< /Length 0 >>\nstream\nunterminated"]);
|
||||
// Null by parse_indirect. Use a stream with neither endstream nor /Length to exercise a real
|
||||
// read error (with a /Length that fits, the stream is that many bytes).
|
||||
let unreadable = fixture(&[STAMP, "<< >>\nstream\nunterminated"]);
|
||||
assert!(unreadable.repair_log().is_empty());
|
||||
assert!(unreadable.try_get(4).is_err());
|
||||
assert!(unreadable.scan_objects_checked().any(|(r, object)| r.num == 4 && object.is_err()));
|
||||
|
||||
Reference in new issue
Block a user