test(vector): pin empty-chunk-list parity for all-blank pages
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) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.8
parent
446320983a
commit
0fada20d35
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user