From 2a4c2967f25985842f386ac9f9a20c6abfd395fe Mon Sep 17 00:00:00 2001 From: dnjsgkfka Date: Thu, 22 Oct 2026 17:58:49 +0900 Subject: [PATCH] =?UTF-8?q?test:=20=EA=B2=BD=EA=B3=84=20=ED=85=8C=EC=8A=A4?= =?UTF-8?q?=ED=8A=B8=20=EC=9E=85=EB=A0=A5=EC=9D=84=20=EB=B6=84=ED=95=A0=20?= =?UTF-8?q?=EA=B0=80=EB=8A=A5=ED=95=9C=20=ED=91=9C=EB=A1=9C=20=EB=8C=80?= =?UTF-8?q?=EC=B2=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tests/specification/test_spec_split.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/tests/specification/test_spec_split.py b/tests/specification/test_spec_split.py index 48e54a9..6613ed1 100644 --- a/tests/specification/test_spec_split.py +++ b/tests/specification/test_spec_split.py @@ -16,15 +16,25 @@ def test_qa33_token_count_matches_tiktoken(): @pytest.mark.parametrize("size,strategy",[(512,"single"),(513,"row_split")]) def test_qa33_exact_512_513_boundary(size,strategy): # Real tokenizer; no mocked token counter. Padding creates the boundary input. + # 입력은 행 분할로 실제 한도를 맞출 수 있는 표여야 한다. 데이터 행이 하나뿐인 + # 표는 513토큰이어도 쪼갤 수단이 없어 QA-37의 llm_summary로 빠지며, 그 경로는 + # test_qa37_oversized_or_single_row_returns_original이 따로 검증한다. + rows=10 + body="".join(f"R{r}{r}" for r in range(1,rows+1)) + sentences=[f"R{r} | Value: {r}" for r in range(1,rows+1)] e=EvidenceUnit(eu_id="boundary",page_no=1, - table_html="
Value
42
", - row_sentence_map={1:["Value: 42"]},flattened_rows=["Value: 42"]) + table_html=""+body+"
NameValue
", + row_sentence_map={r:[sentences[r-1]] for r in range(1,rows+1)}, + flattened_rows=list(sentences)) for n in range(1,700): e.context_before=["x "*n] if count_eu_tokens(e)==size:break assert count_eu_tokens(e)==size, "Tokenizer boundary fixture could not be constructed" result=split_eu(e) assert result.strategy==strategy + if strategy=="row_split": + assert all(count_eu_tokens(c)<=512 for c in result.chunks) + @pytest.mark.spec("QA-33") def test_qa33_larger_limit_reduces_chunk_count():