Files
Aislo/resources/tester/test_855_block.py
T
eomsangdonandClaude Opus 5.5 327fdc5d9b test(855-A): 걸음 2 지킴 시험 다섯 — 옛 엔진 대 새 계산기 · 새 답 지문 · SK 견본 · 막힘 · 불러오기 옛 검산
- test_855_engine_parity: 로직 전수 기본 입력 L0 ~ L3 옛 대 새 · 다름 = 채택 목록(빌더 ADOPTED)과 같음 · 보이는 단가만 다름은 허용 갈래 · 옵션 전수 = S855_ALL=1
- test_855_golden + golden_855_engine.json: 새 계산기 답 지문(로직마다 기본 + 옵션 표본) · 다르면 실패 · 다시 뜨기 = --write(자료를 뜻대로 바꾼 걸음만)
- test_855_sk_layers: 임시 층 SK 견본(바탕 · 옛 칸 더한줄 · 율 더한줄 · 형제 SK · 가져온 식) 옛 = 새 · 줄 합 = 기준 · 「따로」 는 지금 사실(줄 = 옛 · 기준 = 새)을 단언 — 2-C1 에서 뒤집음
- test_855_block: 막힘 옛(check_logic) = 새(문서 표지) · 틀린 식은 둘 다 막힘
- test_812_1_xlsx_golden: 금액 표본 sweep 에 옛 검산(옛 엔진) = 새 셈 단언 하나
- 도우미 helper_855_engine(경우 · 층 가름 · 지문) · 제품 코드 고침 0
- 싱크 관문에는 안 넣음 — 기존 관문 넷이 이미 약 7 분(5 분 넘음)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-17 16:45:14 +09:00

34 lines
1.4 KiB
Python
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
"""855-A 지킴 ④ — 막힘 판정 옛(`master_formula.check_logic` · M01 로직 목록 · `/logic`) = 새(수식 문서
표지 `master_doc.check`) 전수 · 막힘 기준 = 표지만(기본 입력으로 셈이 안 되는 것은 막힘 아님 · 판정 855-0).
걸음 2-B3(막힘 검사를 문서 기준으로) 앞뒤로 같아야 함 · 옛 검사를 지우는 걸음에서 옛 쪽만 뗌."""
from __future__ import annotations
import importlib
import helper_855_engine as h
md = importlib.import_module("master_doc")
def test_막힘_옛_새_같음():
rows, whole, docs, _ = h.world()
old = {str(r["키"]) for r in rows if h.mf.check_logic(whole, r)[0]}
new = {str(r["키"]) for r in rows if str(r["키"]) not in docs or md.check(docs[str(r["키"])])}
assert old == new, {"옛만 막힘": sorted(old - new)[:20], "새만 막힘": sorted(new - old)[:20]}
def test_틀린_식은_옛_새_모두_막힘():
"""자가 살아 있는지 — 같은 로직의 식을 틀리게 하면 두 판정 모두 막힘(사본만 · 자료 안 고침)."""
import copy
rows, whole, docs, _ = h.world()
row = next(r for r in rows if r.get("호표") and str(r["키"]) in docs)
bad_row = copy.deepcopy(row)
bad_row["호표"][0]["수량"] = "없는변수 * 2"
bad_doc = copy.deepcopy(docs[str(row["키"])])
bad_doc["금액"][0]["수량"] = "없는기호 × 2"
assert h.mf.check_logic(whole, bad_row)[0]
assert md.check(bad_doc)