From 0fada20d35f3834ae5ca0cd0ef3fd1eec7a1723d Mon Sep 17 00:00:00 2001 From: Chris Coutinho Date: Sat, 6 Jun 2026 14:20:03 +0200 Subject: [PATCH] test(vector): pin empty-chunk-list parity for all-blank pages MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Address claude-review round 5 on PR #868: add test_all_blank_pages_returns_empty_list documenting that PageAwareChunker returns [] when every page is blank — and asserting parity with DocumentChunker, which already returns [] for whitespace-only non-empty content. The empty-chunk-list case is therefore pre-existing pipeline behavior, not new to this PR. Co-Authored-By: Claude Opus 4.8 (1M context) --- tests/unit/test_document_chunker.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/tests/unit/test_document_chunker.py b/tests/unit/test_document_chunker.py index 5ee184b2..fbdeaf50 100644 --- a/tests/unit/test_document_chunker.py +++ b/tests/unit/test_document_chunker.py @@ -439,6 +439,22 @@ class TestPageAwareChunker: ] assert all(c.page_number is None for c in pa_chunks) + async def test_all_blank_pages_returns_empty_list(self): + """Non-empty content whose every page is blank yields no chunks. + + Matches DocumentChunker, which also returns [] for whitespace-only + non-empty content — the downstream pipeline handles an empty chunk + list identically for both chunkers. + """ + pages = [" ", "\n\n", "\t"] + content, boundaries = _make_doc(pages) + + chunks = await PageAwareChunker().chunk_text(content, boundaries) + + assert chunks == [] + # Parity: the char-based chunker behaves the same for blank content. + assert await DocumentChunker().chunk_text(content) == [] + async def test_empty_content_returns_single_empty_chunk(self): """Empty content returns one empty chunk regardless of boundaries.""" chunks = await PageAwareChunker().chunk_text(