fix(m01): 자동값 빈 줄에서 텍스트 수식이 멈추지 않음 — 빈 줄은 빈 글

- 빈 줄(후보 0 · 값 빈 품목 · 빈 덧줄)은 글 빈 값 · 금액 null 그대로 · 덧줄 식을 다시 셈하지 않음
- 덧줄 합 · 이름 값에 빈 줄을 넣지 않음
- 자동값으로 1,354 전부 텍스트 멈춤 62 → 0

검증: test_m01_text 23개 통과 · 자동값 1,354 멈춤 0 · GC000027 계 = 계산 계.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ACe3CR4gBWhWUN5p44fLe4
This commit is contained in:
2026-09-24 09:10:11 +09:00
co-authored by Claude Sonnet 5
parent d2380094cb
commit de8e1d51c2
2 changed files with 39 additions and 4 deletions
+28
View File
@@ -303,3 +303,31 @@ def test_글_안의_돈은_정수_계산_값은_소수_그대로(client: TestCli
first = _all_lines(got)[0]
assert first["글"] == "275,790 * 0.22 * 1.31 = 79,483" # 수량·비율은 소수 그대로
assert Decimal(str(first["금액"])) == Decimal("79482.678") # 값은 그대로
def test_자동값으로_모든_로직을_돌려도_멈추지_않는다() -> None:
"""빈 줄(후보 0 · 값 빈 품목) — 그 줄만 빈 글 · 로직은 계속(PLAN 3-2)."""
files = store.cm.load(folder=REAL)
master = store.cm.master(REAL)
stops = []
for rows in master.index.values():
for key in rows:
if mt.mf.mk.GROUP_OF.get(key[:2]) != "로직":
continue
given = {n: store._dec(v) for n, v in store.auto(key)["값"].items()}
try:
mt.lines(files, key, given)
except mt._CALC_ERRORS as e:
stops.append((key, str(e)))
assert not stops, stops[:3]
def test_빈_줄은_빈_글이고_소계는_빈_줄_빼고_더한다(client: TestClient) -> None:
key = "GC000027"
given = {n: str(v) for n, v in store.auto(key)["값"].items()}
got = client.post("/api/m01/text", json={"key": key, "inputs": given}).json()
calc = client.post("/api/m01/calc", json={"key": key, "inputs": given}).json()
assert got["ok"] is True
blank = [one for one in _all_lines(got) if one["금액"] is None]
assert blank and all(one["글"] == "" and one["까닭"] for one in blank)
assert Decimal(str(got["계"])) == Decimal(str(calc["sums"]["계"]))