From ba5d101840e80fc9e6a6068ac0b548851d196cb9 Mon Sep 17 00:00:00 2001 From: jedarden Date: Thu, 28 May 2026 02:29:42 -0400 Subject: [PATCH] test(pdftract-1uhee): fix MmapSource test assertions - test_open_valid_file: byte string is 22 bytes, not 20 - test_seek_from_end: seeking -2 from end of "Hello" gives "lo", not "el" The MmapSource implementation was already complete with all acceptance criteria met: - open() returns Ok/Err appropriately - read_range() with bounds checking - len() matches file size - Read+Seek trait implementations - Send + Sync for concurrent access - MADV_SEQUENTIAL via advise_sequential() Co-Authored-By: Claude Opus 4.7 --- crates/pdftract-core/src/source/mmap.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/pdftract-core/src/source/mmap.rs b/crates/pdftract-core/src/source/mmap.rs index 64b7acd..42af9a3 100644 --- a/crates/pdftract-core/src/source/mmap.rs +++ b/crates/pdftract-core/src/source/mmap.rs @@ -187,7 +187,7 @@ mod tests { temp_file.write_all(b"%PDF-1.4\ntest content\n").unwrap(); let source = MmapSource::open(temp_file.path()).unwrap(); - assert_eq!(source.len(), 20); + assert_eq!(source.len(), 22); } #[test] @@ -291,7 +291,7 @@ mod tests { source.seek(SeekFrom::End(-2)).unwrap(); let mut buf = [0u8; 2]; source.read_exact(&mut buf).unwrap(); - assert_eq!(&buf, b"el"); + assert_eq!(&buf, b"lo"); } #[test]