From bce7e245e0800ec5e37127d37c8cbafd4331bb3a Mon Sep 17 00:00:00 2001 From: umsangdon Date: Thu, 12 Nov 2026 06:07:14 +0900 Subject: [PATCH] =?UTF-8?q?fix(820-2):=20=EC=8B=9C=EA=B0=84=EB=8B=B9=20?= =?UTF-8?q?=EC=9D=B4=EC=9D=8C=20=EA=B8=80=20=EB=B9=88=EC=B9=B8=20=EB=93=A0?= =?UTF-8?q?=20=EC=9E=85=EB=A0=A5=20=EC=9D=B4=EB=A6=84=20=EB=94=B0=EC=98=B4?= =?UTF-8?q?=ED=91=9C=20=E2=80=94=20=ED=8C=8C=EC=9B=8C=ED=8A=B8=EB=A1=9C?= =?UTF-8?q?=EC=9B=B0=20EST=20main=20504=20=EB=B2=88=20=EC=98=A4=EB=A5=98?= =?UTF-8?q?=20=EA=B3=A0=EC=B9=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - M02_San_Link.hourly_text 가 「전력 계약종별=…」 를 따옴표 없이 적어 가져온 식 읽기(_link)가 못 읽음 → 이름을 따옴표로(읽는 쪽은 이미 받음) - 지킴 시험(test_820_1) 왕복 + EST main 504 번 = 저장 금액 · 우리 단가 셈 추가 Co-Authored-By: Claude Sonnet 5.5 --- M02_MasterTemplete/M02_San_Link.py | 3 ++- resources/tester/test_820_1_small_machines.py | 20 +++++++++++++++++++ 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/M02_MasterTemplete/M02_San_Link.py b/M02_MasterTemplete/M02_San_Link.py index 986f4e0b2..747d0115c 100644 --- a/M02_MasterTemplete/M02_San_Link.py +++ b/M02_MasterTemplete/M02_San_Link.py @@ -114,7 +114,8 @@ def hourly_text(key: str | None) -> str | None: got = dim.hourly_link(key, "노무비") if not got: return None - return f"로직({got['키']}{''.join(f', {k}={v}' for k, v in got['입력'].items())})" + args = "".join(f", {dim._q(k)}={v}" for k, v in got["입력"].items()) # 빈칸 든 이름은 따옴표 + return f"로직({got['키']}{args})" def combo_link(one: dict, parts: list[dict]) -> str | None: diff --git a/resources/tester/test_820_1_small_machines.py b/resources/tester/test_820_1_small_machines.py index 24c11c887..5c5b01eae 100644 --- a/resources/tester/test_820_1_small_machines.py +++ b/resources/tester/test_820_1_small_machines.py @@ -151,3 +151,23 @@ def test_other_docs_same() -> None: assert pick[0] not in codes, row["키"] old = [k for k, r in _eq().items() if k not in NEW] assert not [k for k in old if str(_eq()[k].get("원문번호") or "").startswith("자체 ")] + + +def test_blank_input_name_link_roundtrip() -> None: + """820-2 — 빈칸 든 입력 이름(「전력 계약종별」)이 이음 글 → 읽기 왕복 · EST main 504 번 = 저장 금액 · 우리 단가 셈.""" + from M02_MasterTemplete import M02_San_Link as sl + from M02_MasterTemplete import M02_Sangeun_Imported as imp + + text = sl.hourly_text("EQ000662") + assert "'전력 계약종별'=" in text + node = di.dc.cv.mf.parse(text) + assert node[0] == "logic" and "전력 계약종별" in [k for k, _ in node[2]] + assert imp._link(text, "로직", "시험", imp._whole()) == text + import test_810_2_native_doc as t + + out = t.fn.emit(t.native("EST", "main"), 504) + sk, _, got = t.doc_and_money(out) + assert float(got["계"]) == 546 # 원파일 저장 금액 + sk[imp.KEY]["단가기준"] = "우리" + ours = di.run(di.derive(sk, None, t.whole()), sk, t.whole()) + assert ours.get("셈됨") is not False and ours["계"] is not None