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:
mtlcl410andClaude Opus 5.5 committed 2026-11-05 22:09:41 +08:00
1 parent 12cb7c5ce1
commit 1a8922203d
1 file changed
+3 -2
+3 -2
View File
@@ -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()));