From 56739989713c6cbc2a1938159092c19794458ed1 Mon Sep 17 00:00:00 2001 From: umsangdon Date: Mon, 16 Nov 2026 21:05:28 +0900 Subject: [PATCH 1/4] =?UTF-8?q?feat(848-2):=20Doc=5FSk=20=EC=84=B8=20?= =?UTF-8?q?=EC=A4=84=20=E2=80=94=20=EC=9B=90=EB=B3=B8=20=ED=8C=90=20=3D=20?= =?UTF-8?q?=EA=B3=84=EC=82=B0=20=EB=82=B4=EC=9A=A9=20=EC=A7=80=EB=AC=B8=20?= =?UTF-8?q?=C2=B7=20=ED=8C=8C=EC=83=9D=20=EC=A0=80=EC=9E=A5=EC=97=90=20?= =?UTF-8?q?=EB=A7=A1=EA=B8=B4=20=EC=B9=B8=20=EC=8B=A4=EC=9D=8C=20=C2=B7=20?= =?UTF-8?q?=EC=95=8C=EB=A6=BC=20[=ED=99=95=EC=9D=B8]=20=EB=95=8C=20?= =?UTF-8?q?=EB=B0=94=ED=83=95=20=EA=B1=B7=EC=9D=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - copy_of 원본 판 = dc.doc_fp(기초 덮음 · 글만 바뀜 = 따로 문서 그대로) - settle 파생 갈래 = renew.KEEP(기계덮음 · 맡긴값 · 덮음바탕) 이어 실음(재생성 빼고) — 다시 복사 뒤 저장해도 기계 고침 · 옵션 값 남음 - settle 의 renew.form 에 confirm = 할일 갱신확인 - 시험 test_848_2: 「붙인 뒤」 xfail 셋 걷음 · 기초 기계덮음만 바뀜 = 따로 SK 문서 고침 그대로(sub2 남긴 경우) · ① 안 고친 칸 따라옴 금액 확인 더함 - 시험 test_848_1: M01 문서 파일 전후 바이트 비교를 줄 끝 무시로 — autocrlf 워크트리(CRLF 로 풀림)에서 저장이 LF 로 써 줄 끝만 달라 실패하던 것 Co-Authored-By: Claude Opus 5.5 --- M02_MasterTemplete/M02_Doc_Sk.py | 6 +++-- resources/tester/test_848_1_cover_layers.py | 4 ++- resources/tester/test_848_2_cover_renew.py | 29 ++++++++++++++------- 3 files changed, 27 insertions(+), 12 deletions(-) diff --git a/M02_MasterTemplete/M02_Doc_Sk.py b/M02_MasterTemplete/M02_Doc_Sk.py index 295590e3c..628874cac 100644 --- a/M02_MasterTemplete/M02_Doc_Sk.py +++ b/M02_MasterTemplete/M02_Doc_Sk.py @@ -170,7 +170,7 @@ def copy_of(sk: dict, ctx: tuple | None) -> dict | None: calls = dc.closure(whole, [*dc.calls(root), *dc.upper_calls(got)], got.get("부름")) base = str((sk.get("바탕") or {}).get("로직") or "") seen = dc.doc_of(whole, base) if base else None # 바탕 M01 문서 판(「M01 새 판」 표지) - origin = {"원본": {"키": base, "판": dc.fp(seen)}} if seen else {} + origin = {"원본": {"키": base, "판": dc.doc_fp(seen)}} if seen else {} return {**got, **values, "문서": root, "부름": calls, **origin} @@ -225,7 +225,7 @@ def settle(out: dict, whole: Any, job: Any, raw: Any) -> dict: file = stored(out.get("키")) or {} have = file.get(KEY) if dc.has(file) else (raw.get(KEY) if dc.has(raw) else None) have = ( - upper(out, renew.form(out, have)) if have else have + upper(out, renew.form(out, have, confirm=job == renew.CONFIRM)) if have else have ) # 836-2 · ① 위 층 덮음(848-1) — 저장 때 굳음 if have and have.get("따로") and job != skc.REGEN: if file and old_fp(file) != old_fp(out): @@ -248,6 +248,8 @@ def settle(out: dict, whole: Any, job: Any, raw: Any) -> dict: first = {**(dc.values_of(out[skc.KEY]) if skc.has(out) else {}), "부름": calls} if job != skc.REGEN and (have or {}).get("끊음"): # 안 바뀐 항목 고침 = 그대로(836-2) first["끊음"] = have["끊음"] + if job != skc.REGEN: # 맡긴 기계 고침 · 옵션 값 · 지킨 칸 바탕(848-2) + first |= {k: have[k] for k in renew.KEEP if (have or {}).get(k)} if (have or {}).get( UPPER ): # ① = 저장본(프로젝트 층) · 밖은 `copy_of` 가 지금 기초 것으로(848-1) diff --git a/resources/tester/test_848_1_cover_layers.py b/resources/tester/test_848_1_cover_layers.py index 6d900a91f..dde16ddd5 100644 --- a/resources/tester/test_848_1_cover_layers.py +++ b/resources/tester/test_848_1_cover_layers.py @@ -262,7 +262,9 @@ def test_M01_기초_고침_빌더_이어받기_되돌림(docs_tmp): back = {NO: {"값": {"가격": float(d["값"]["가격"])}, "조종원": d["조종원"]}, SYM: {"작업량": {"방식": "일당"}}} # fmt: skip got = _save_m01(back) - assert COVER not in got["문서"] and file.read_bytes() == orig + assert COVER not in got["문서"] and file.read_bytes().replace(b"\r", b"") == orig.replace( + b"\r", b"" + ) # 줄 끝(autocrlf) 무시 assert got["셈"]["계"] == before diff --git a/resources/tester/test_848_2_cover_renew.py b/resources/tester/test_848_2_cover_renew.py index 03fcf783c..453926451 100644 --- a/resources/tester/test_848_2_cover_renew.py +++ b/resources/tester/test_848_2_cover_renew.py @@ -15,8 +15,6 @@ from __future__ import annotations import copy import shutil -import pytest - from M01_MasterData import M01_MasterData_Store as m01 from M02_MasterTemplete import M02_Doc_Sk_Path as path from M02_MasterTemplete import M02_Labor_Ref as refs @@ -31,7 +29,6 @@ CUT = ( "GC000085" # 흙깎기(기계) 보통토사 — 굴착기 1.0㎥(0201-0100) 부름 · 옵션 규모 · 지역 · 보정작업 ) PRICE = 142069 # 굴착기 1.0㎥ M01 가격 -WAIT = pytest.mark.xfail(reason="M02_Doc_Sk 세 줄(848-2 a · b · c) 붙인 뒤", strict=True) def _eq_move(monkeypatch, key: str, fn) -> None: @@ -127,7 +124,7 @@ def test_label_only(world, monkeypatch): def test_crew_list_kept(world, monkeypatch): - """㉡ 목록 칸 — 기계 인력 줄 바뀜 + 인력 고침 = 지킴 알림(목록 글) · 가격 고침 칸은 알림 없음.""" + """㉡ 목록 칸 — 인력 줄 바뀜 + 인력 고침 = 지킴 알림(목록 글) · 가격 칸 알림 없음.""" me = world["personal"] mine = [{"키": "LB:1048", "인": 2}] key = _machine_sk(me, {"값": {"가격": 150000}, "조종원": mine}) @@ -137,9 +134,8 @@ def test_crew_list_kept(world, monkeypatch): assert note["M01"] == ["인력 LB:1048 1인 → LB:1048 1.5인"] -@WAIT def test_upper_only(world, monkeypatch): - """㉣ 기초 고침(①)만 바뀜(+ 이름 글) = 따로 문서 그대로 · 내 고침 칸을 ① 이 바꾸면 지킴 알림(층 기초) · + """㉣ 기초 고침(①)만 바뀜(+ 이름) = 따로 문서 그대로 · ① 이 내 고침 칸을 바꿈 = 지킴(층 기초) · ② 없는 칸(주연료)은 알림 없음.""" me = world["personal"] key = _cut_sk(me, cover={"값": {"가격": 150000}}) @@ -156,6 +152,7 @@ def test_upper_only(world, monkeypatch): assert got["문서"]["기계덮음"] == {DIG_NO: {"값": {"가격": 150000}}} [note] = got["사본"]["갱신"] assert (note["경로"], note["층"], note["전"], note["후"]) == ("값.가격", "기초", PRICE, 200000) + assert got["셈"]["계"] > was["셈"]["계"] # 안 고친 칸(주연료 ①) = 따라옴 · 가격 = 내 값 assert not got["사본"]["문서새판"] @@ -189,7 +186,7 @@ def _grow(d: dict) -> None: def test_structure_recopy(world, monkeypatch): - """㉤ 기초에 줄이 더해짐 = 다시 복사(따로 아님) · 기계 고침 · 옵션 값 다시 얹음 · 알림 다시복사.""" + """㉤ 기초에 줄 더함 = 다시 복사(따로 아님) · 기계 고침 · 옵션 값 다시 얹음 · 알림 다시복사.""" me = world["personal"] cover = {"값": {"가격": 150000}} key = _cut_sk(me, cover=cover) @@ -203,7 +200,6 @@ def test_structure_recopy(world, monkeypatch): assert note["다시얹음"] == ["규모 소규모"] -@WAIT def test_structure_recopy_saved(world, monkeypatch): """㉤ 다시 복사한 뒤 알림 [확인](저장) = 기계 고침 · 옵션 값 남음 · 알림 없음.""" me = world["personal"] @@ -229,7 +225,6 @@ def test_save_keeps_base(world, monkeypatch): assert (note["전"], note["후"]) == (PRICE, PRICE * 2) -@WAIT def test_confirm_clears(world, monkeypatch): """㉥ 알림 [확인] 뒤 = 안 뜸 · 내 값 그대로 · 금액 같음.""" me = world["personal"] @@ -288,3 +283,19 @@ def test_imported_same_rule(world, monkeypatch): with store.at(me): [note] = renew.notes(sk) assert (note["처리"], note["경로"], note["후"]) == ("지킴", "값.가격", PRICE * 2) + + +def test_upper_cover_keeps_edited_doc(world, monkeypatch): + """㉣ 기초 문서의 `기계덮음`(①)만 바뀜 = 그 기초로 만든 따로 SK 문서 고침 그대로 · 알림 없음 + (문서 지문에서 덮음 뺌 — 848-1 이 남긴 경우).""" + from resources.tester.test_836_2_sk_auto_renew import TOOL, _base, _edit + + me = world["personal"] + key = _base(me) + _edit(me, key, "노무비 × 5%") + was = _read(me, key) + _doc_move(monkeypatch, "GC001109", lambda d: d.update(기계덮음={DIG_NO: {"값": {"가격": 1}}})) + got = _read(me, key) + assert got["사본"]["따로"] is True and got["사본"]["갱신"] == [] + assert got["문서"]["금액"][TOOL]["단가"] == "노무비 × 5%" + assert got["셈"]["계"] == was["셈"]["계"] and not got["사본"]["문서새판"] From a3282d33aae672a7152c2f8aa64b73b561540862 Mon Sep 17 00:00:00 2001 From: umsangdon Date: Mon, 16 Nov 2026 21:28:46 +0900 Subject: [PATCH 2/4] =?UTF-8?q?fix(848-3):=20=EB=AC=B8=EC=84=9C=20?= =?UTF-8?q?=ED=86=B5=EC=A7=B8=20=EC=B4=88=EA=B8=B0=ED=99=94=EA=B0=80=20?= =?UTF-8?q?=EC=88=98=EC=8B=9D=20=EA=B8=B8=20=EC=98=B5=EC=85=98=20=EA=B0=92?= =?UTF-8?q?=EC=9D=84=20=EC=A7=80=ED=82=B4=20=C2=B7=20=EC=9D=B4=EB=A6=84=20?= =?UTF-8?q?=C2=B7=20=EC=98=B5=EC=85=98=EB=A7=8C=20=EA=B3=A0=EC=B9=9C=20?= =?UTF-8?q?=EB=AC=B8=EC=84=9C=EB=8A=94=20=E3=80=8C=EC=88=98=EC=8B=9D=20?= =?UTF-8?q?=EA=B3=A0=EC=B9=A8=E3=80=8D=20=EB=AA=A9=EB=A1=9D=EC=97=90?= =?UTF-8?q?=EC=84=9C=20=EB=BA=8C=20=C2=B7=20=EC=95=8C=EB=A6=BC=20=EB=8B=A8?= =?UTF-8?q?=EC=B6=94=20=EC=B9=B8=20=EB=84=93=ED=9E=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 재생성 할일 전에 수식 문서 옵션(입력 · 선택) 값을 입력값으로 옮김(옵션 · 기본정보 그대로) - 줄 · 식 판정 = 셈 칸 지문(doc_fp) · 옵션 값 뺌 - 시험 test_848_3_reset_whole ④(지역 옵션 남음 · 목록 = 기계 고침만) Co-Authored-By: Claude Opus 5.5 --- A00_Common/formula_doc_renew.ts | 2 +- M02_MasterTemplete/M02_Library_Flat.py | 37 ++++++++++++++++++---- resources/tester/test_848_3_reset_whole.py | 16 ++++++++++ 3 files changed, 48 insertions(+), 7 deletions(-) diff --git a/A00_Common/formula_doc_renew.ts b/A00_Common/formula_doc_renew.ts index 8fce5d39c..9e5c69181 100644 --- a/A00_Common/formula_doc_renew.ts +++ b/A00_Common/formula_doc_renew.ts @@ -73,7 +73,7 @@ export async function askRenew( { label: ft("Renew_Item"), width: "28%" }, { label: ft("Renew_Upper") }, { label: ft("Renew_Kept") }, - { label: "", width: "96px" }, + { label: "", width: "120px" }, ], kept.map((n) => { const b = createButton({ diff --git a/M02_MasterTemplete/M02_Library_Flat.py b/M02_MasterTemplete/M02_Library_Flat.py index d95f698ed..b4f573445 100644 --- a/M02_MasterTemplete/M02_Library_Flat.py +++ b/M02_MasterTemplete/M02_Library_Flat.py @@ -525,9 +525,23 @@ def _reset_sc(doc: dict) -> tuple[dict, int]: return {**doc, "담은로직": lines}, n +_OPT_KINDS = ("입력", "선택") + + +def _options(mine: dict) -> dict: + """수식 문서 옵션 값 {열쇠: 값}(입력 · 선택).""" + return { + v["열쇠"]: v["연결"]["값"] + for v in mine.get("변수") or [] + if isinstance(v, dict) and v.get("열쇠") and (v.get("연결") or {}).get("갈래") in _OPT_KINDS + and "값" in (v.get("연결") or {}) + } # fmt: skip + + def formula_edits(doc: dict) -> list[str]: """수식 길 고침(889) — 줄 · 식 고친 문서 · 끊은 부름 · 기계 고침 목록(가져온 식 = 없음 · 엑셀 원본 대비 · - 바탕 기초 없는 SK = 없음 · 같게 할 기초가 없어 줄을 지키고 기계 고침은 줄마다 되돌림).""" + 바탕 기초 없는 SK = 없음 · 같게 할 기초가 없어 줄을 지키고 기계 고침은 줄마다 되돌림) · + 줄 · 식 판정 = 셈 칸 지문(`doc_fp` · 이름 · 글 칸 뺌) · 옵션 값은 남기니 판정에서 뺌.""" from M02_MasterTemplete import M02_Doc_Copy as dc from M02_MasterTemplete import M02_Doc_Import as imp @@ -536,20 +550,28 @@ def formula_edits(doc: dict) -> list[str]: return [] mine, first = got.get("문서") or {}, got.get("처음") - def bare(d: dict) -> dict: - return {k: v for k, v in d.items() if k != "기계덮음"} + def calc_fp(d: dict) -> str: + rows = [ + {**v, "연결": {k: x for k, x in v["연결"].items() if k != "값"}} + if isinstance(v, dict) and (v.get("연결") or {}).get("갈래") in _OPT_KINDS + else v + for v in d.get("변수") or [] + ] + return dc.doc_fp({**d, "변수": rows}) covers = {**(got.get("기계덮음") or {}), **(mine.get("기계덮음") or {})} items = [f"기계 고침 — {k}" for k in sorted(covers)] items += [f"끊은 부름 — {k}" for k in sorted(got.get("끊음") or {})] - if got.get("따로") and (not isinstance(first, dict) or dc.fp(bare(mine)) != dc.fp(bare(first))): + if got.get("따로") and (not isinstance(first, dict) or calc_fp(mine) != calc_fp(first)): items.insert(0, "수식 문서 고침(줄 · 식)") return items def reset(kind: str, doc: dict) -> tuple[dict, int]: """[초기화] — (걷은 문서, 걷힌 고침 수) · 먼저 펼침(옛 참조 줄도 M01 키로) · - SK 수식 길 고침(따로 문서 · 끊음 · 기계 고침 · 889) = 재생성 할일로 함께 걷음(그 기초와 같게).""" + SK 수식 길 고침(따로 문서 · 끊음 · 기계 고침 · 889) = 재생성 할일로 함께 걷음(그 기초와 같게) · + 수식 문서 옵션 값 = 입력값으로 옮겨 남김(옵션 · 기본정보 그대로).""" + from M02_MasterTemplete import M02_Doc_Copy as dc from M02_MasterTemplete import M02_Sangeun_Copy as skc doc = flat_doc(kind, doc) @@ -557,7 +579,10 @@ def reset(kind: str, doc: dict) -> tuple[dict, int]: adds, n = _reset_adds(doc.get("더한줄") or []) n += const.covers_n(doc) # 790-2 상수 · 표값 덮개도 걷음(까닭 같이) items = formula_edits(doc) - out = {**const.restore(doc), "더한줄": adds, **({skc.JOB: skc.REGEN} if items else {})} + out = {**const.restore(doc), "더한줄": adds} + if items: + opts = _options((doc.get(dc.KEY) or {}).get("문서") or {}) + out |= {skc.JOB: skc.REGEN, "입력값": {**(doc.get("입력값") or {}), **opts}} return out, n + len(items) return _reset_sc(doc) diff --git a/resources/tester/test_848_3_reset_whole.py b/resources/tester/test_848_3_reset_whole.py index 3b302a493..9d772422b 100644 --- a/resources/tester/test_848_3_reset_whole.py +++ b/resources/tester/test_848_3_reset_whole.py @@ -4,6 +4,7 @@ ① 기초(GF000099 · 굴착기 0201-0070)를 바탕으로 한 SK 에 기계 고침을 수식 길로 저장 → 금액 바뀜. ② 미리 보기 = 목록에 「기계 고침 — 0201-0070」 · 파일 그대로. ③ 초기화 = 따로 · 기계 고침 걷힘 · 금액 = 처음(기초와 같음) · 다시 미리 보기 = 걷을 것 0. +④ 수식 길로 옵션(지역) · 이름을 같이 고친 SK = 목록엔 기계 고침만 · 초기화 뒤 옵션 값 남음. """ import copy as cp @@ -41,3 +42,18 @@ def test_문서_통째_초기화_기계_고침까지(tmp_path, monkeypatch): assert not file["수식"].get("따로") and mcv.COVER not in (file["수식"].get("문서") or {}) assert path.read(key)["셈"]["계"] == was assert flat.reset_doc("sangeun", key, None, True, None)["걷힘"] == 0 + + with store.at(me): + key = refs.create("sangeun", body)["이름"] + first = path.read(key) + doc = cp.deepcopy(first["문서"]) + area = next(v for v in doc["변수"] if v.get("열쇠") == "지역") + area["연결"]["값"] = area["연결"]["목록"][1] + doc["이름"] = "sub3임시 이름 고침" + doc[mcv.COVER] = {NO: {"값": {"가격": 900000}}} + path.save(key, {"문서": doc, "판": first["판"]}) + assert flat.reset_doc("sangeun", key, None, True, None)["목록"] == [f"기계 고침 — {NO}"] + flat.reset_doc("sangeun", key, None, False, None) + after = path.read(key)["문서"] + kept = next(v for v in after["변수"] if v.get("열쇠") == "지역")["연결"]["값"] + assert kept == area["연결"]["목록"][1] and mcv.COVER not in after From 30736a974956da4159780739702e4f133d0f6b10 Mon Sep 17 00:00:00 2001 From: umsangdon Date: Mon, 16 Nov 2026 21:28:46 +0900 Subject: [PATCH 3/4] =?UTF-8?q?fix(848-3):=20=EA=B0=80=EC=A0=B8=EC=98=A8?= =?UTF-8?q?=20=EA=B3=B5=EC=8B=9D=20=EC=A4=84=20=EC=88=98=EB=A7=8C=EC=9D=B8?= =?UTF-8?q?=20=EA=B2=B9=EB=B6=84=EC=88=98=EB=8F=84=20=EC=A4=84=20=EB=82=98?= =?UTF-8?q?=EB=88=94(=EB=91=90=20=EC=B8=B5=20=EC=95=88)=20=C2=B7=20?= =?UTF-8?q?=EC=B9=B8=20=ED=85=8C=EB=91=90=EB=A6=AC=20=ED=91=9C=EC=8B=9C?= =?UTF-8?q?=EA=B0=80=20=EA=B0=80=EC=A7=9C=20DOM=20=EC=8B=9C=ED=97=98?= =?UTF-8?q?=EC=97=90=EC=84=9C=EB=8F=84=20=EB=8F=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 산출근거 공식 묶음 — 기호 없는 식이라도 두 층 넘는 분수면 중간 줄 규칙으로(EST main 33 Q = (4.5 + 5.5) ÷ (2 × 0.35)) · 16 블록 × 엑셀 · 우리 두 판 겹분수 0 · 금액 · 문서 그대로 - markDiff = 클래스로만 찾음(matches 없는 가짜 DOM 시험 헬퍼) - 시험 test_848_3_import_frac(EST main 33 · 엑셀 북부청임도 43 · 옛 코드에서 실패 확인) Co-Authored-By: Claude Opus 5.5 --- A00_Common/line_stack_machine_ctl.ts | 3 +- A00_Common/line_stack_out.ts | 6 ++- resources/tester/test_848_3_import_frac.py | 44 ++++++++++++++++++++++ 3 files changed, 50 insertions(+), 3 deletions(-) create mode 100644 resources/tester/test_848_3_import_frac.py diff --git a/A00_Common/line_stack_machine_ctl.ts b/A00_Common/line_stack_machine_ctl.ts index 2df0e34e8..aad4d4dcb 100644 --- a/A00_Common/line_stack_machine_ctl.ts +++ b/A00_Common/line_stack_machine_ctl.ts @@ -77,7 +77,8 @@ export const diffOf = (src: Source | undefined): UiDiff | null => /** 칸 묶음 안 입력 · 고르기 · 이름 단추에 「바뀜」 상태 · 풍선(원래 값) */ export function markDiff(box: HTMLElement, diff: UiDiff | null, was?: string): void { - const nodes = box.matches(".ui-input, .ui-select, .ui-btn") ? [box] : [...box.querySelectorAll(".ui-input, .ui-select, .ui-btn.lstk-res")]; // prettier-ignore + const own = ["ui-input", "ui-select", "ui-btn"].some((c) => box.classList.contains(c)); + const nodes = own ? [box] : ["ui-input", "ui-select", "lstk-res"].flatMap((c) => [...box.querySelectorAll(`.${c}`)]); // prettier-ignore for (const n of nodes) { setUiDiff(n, diff); if (diff && was !== undefined) diff --git a/A00_Common/line_stack_out.ts b/A00_Common/line_stack_out.ts index e77d05e4e..e74038bcf 100644 --- a/A00_Common/line_stack_out.ts +++ b/A00_Common/line_stack_out.ts @@ -241,9 +241,11 @@ function rows( const v = vals[id]; const t = lines.get(id); const head = katexNode(symTex(alias[id] ?? id)); - if (t !== undefined && hasVar(t)) { + const tn = t === undefined ? null : nodeOf(t); + // 848-3 수만인 식도 두 층 넘는 분수면(가져온 공식 줄 `Q = (4.5 + 5.5) ÷ 2 ÷ 0.35` 꼴) 아래 줄 나눔 규칙으로 + if (t !== undefined && (hasVar(t) || (tn && fracDepth(tn) > 1))) { flush(); - const n = nodeOf(t)!; + const n = tn!; if (!machine && fracDepth(n) <= 1) { push({ h: formula(id, n, v, unit(id), vals, {}) }); continue; diff --git a/resources/tester/test_848_3_import_frac.py b/resources/tester/test_848_3_import_frac.py new file mode 100644 index 000000000..f97d9eb7d --- /dev/null +++ b/resources/tester/test_848_3_import_frac.py @@ -0,0 +1,44 @@ +"""848-3(조사 889b F) — 가져온 공식 줄의 수만인 겹분수도 산출근거에서 두 층 안(줄 나눔 규칙) · 금액 · 문서 그대로. + +짝 = `A00_Common/line_stack_out.ts` 공식 묶음(`block` — 수만인 식이 두 층 넘는 분수면 중간 줄 길) · +그리기 = 진짜 화면 코드를 가짜 DOM 으로(`helper_845_2_unit_show.cjs` 「전수」 · 기계 줄 = 위 · 아래 모두 봄). +견본 = EST main 33(석축헐기 Q = (4.5 + 5.5) ÷ 2 ÷ 0.35) · 엑셀 북부청임도 43 — 엑셀 · 우리 두 판. +""" + +import pytest + +from M02_MasterTemplete import M02_Doc_Copy as dc +from M02_MasterTemplete import M02_Doc_FromNative as fn +from M02_MasterTemplete import M02_Doc_Import as dim +from M02_MasterTemplete import M02_San_Xlsx as sx +from M02_MasterTemplete import M02_Sangeun_Imported as imp +from resources.tester import test_797_1a_import_flags as practice +from resources.tester import test_810_1_estx as e +from resources.tester import test_810_2_native_doc as t +from resources.tester import test_846_2_work_view as w2 + + +def _saved(kind: str, tag: str): + if kind == "엑셀": + p = practice.FILES[tag] + return fn.pack(sx.read(p.name, p.read_bytes()), p.name) + p = e.FILES[tag] + return fn.read(p.name, p.read_bytes()) + + +@pytest.mark.parametrize("kind,tag,no", [("EST", "main", 33), ("엑셀", "북부청임도", 43)]) +def test_가져온_식_겹분수_두_층_안(kind, tag, no): + p = (practice.FILES if kind == "엑셀" else e.FILES)[tag] + if not p or not p.exists(): + pytest.skip("견본 파일 없음") + sk = t.sk_of(fn.emit(_saved(kind, tag), no)) + doc = dim.derive(sk, None, t.whole()) + cases = [] + for basis in ("엑셀", "우리"): + sk2 = {**sk, imp.KEY: {**sk[imp.KEY], "단가기준": basis}} + cases.append( + {"키": basis, "문서": dim.view(doc, basis), "연결": dim.record(doc, sk2), "기계": True} + ) + got = w2._js({"할일": "전수", "문서들": dc.ml._norm(cases), "보기": []}) + assert [b for g in got for b in g["bad"] if b[0] == "겹분수"] == [] + assert all(g["같음"] for g in got) From 05fcb457764590f73d8b7274d492cb59a2194b4f Mon Sep 17 00:00:00 2001 From: umsangdon Date: Mon, 16 Nov 2026 21:44:41 +0900 Subject: [PATCH 4/4] =?UTF-8?q?test(848-3):=20846-2=20=EC=A0=9C=EC=96=B4?= =?UTF-8?q?=20=EA=B5=AC=EC=97=AD=20=EC=8B=9C=ED=97=98=20=E2=80=94=20?= =?UTF-8?q?=EA=B3=A0=EC=B9=9C=20=EC=B9=B8=20=ED=91=9C=EC=A7=80=EB=A5=BC=20?= =?UTF-8?q?=E3=80=8C=EA=B3=A0=EC=B9=A8=E3=80=8D=20=EA=B8=80=20=EB=8C=80?= =?UTF-8?q?=EC=8B=A0=20[=EC=9B=90=EB=9E=98=20=EA=B0=92]=20=EB=8B=A8?= =?UTF-8?q?=EC=B6=94=EB=A1=9C(=EA=B8=80=20=EB=B0=B0=EC=A7=80=EB=8A=94=20?= =?UTF-8?q?=ED=85=8C=EB=91=90=EB=A6=AC=EB=A1=9C=20=EA=B0=88=EC=9D=8C=20?= =?UTF-8?q?=C2=B7=20=EC=9A=94=EA=B5=AC=20889)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Opus 5.5 --- resources/tester/test_846_2_work_view.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/tester/test_846_2_work_view.py b/resources/tester/test_846_2_work_view.py index 77cc56c3c..ae3b6d3b2 100644 --- a/resources/tester/test_846_2_work_view.py +++ b/resources/tester/test_846_2_work_view.py @@ -133,7 +133,7 @@ def test_왼쪽_제어_구역_방식_변수_칸(gc88): assert "버킷용량 q=[1]㎥" in [t.strip() for t in hour] assert "체적환산계수 f=[0.7]" in [t.strip() for t in hour] e = next(t.strip() for t in hour if t.strip().startswith("E입력")) - assert e.startswith("E입력=[0.8]고침") # 고친 칸 표지 + assert e.startswith("E입력=[0.8]원래 값") # 고친 칸 = [원래 값] 단추(848-3 「고침」 글 → 테두리) @pytest.fixture(scope="module")