diff --git a/resources/tester/helper_150_detail_pick.cjs b/resources/tester/helper_150_detail_pick.cjs index b6ed3c7af..ab212774b 100644 --- a/resources/tester/helper_150_detail_pick.cjs +++ b/resources/tester/helper_150_detail_pick.cjs @@ -29,7 +29,7 @@ function loadTs(full) { } const pick = loadTs(path.join(ROOT, "B06_Section", "B06_Section_UI_Cross_Detail_Pick.ts")); -// ── 그림 복제 흉내 — 평평한 요소 목록 · 「tag.class」 · 「.class」 · 「g.class line」 만 ── +// ── 그림 복제 흉내 — 평평한 요소 목록 · 「tag.class」 · 「.class」 · 「g.class line」 · 「:not(.class)」 만 ── function node(tag, classes, attrs = {}, parent = null) { const set = new Set(classes); return { @@ -45,8 +45,11 @@ function node(tag, classes, attrs = {}, parent = null) { }; } const one = (el, part) => { - const [tag, ...cls] = part.split("."); - return (!tag || el.tag === tag) && cls.every((c) => el.set.has(c)); + const nots = [...part.matchAll(/:not\(\.([\w-]+)\)/g)].map((m) => m[1]); // 370-3 암 판정 선 뺌 + const [tag, ...cls] = part.replace(/:not\([^)]*\)/g, "").split("."); + return ( + (!tag || el.tag === tag) && cls.every((c) => el.set.has(c)) && !nots.some((c) => el.set.has(c)) + ); }; const matches = (el, selector) => { const parts = selector.split(" "); diff --git a/resources/tester/test_294_1_chute_remove_pick.py b/resources/tester/test_294_1_chute_remove_pick.py index d13c77ab5..666640881 100644 --- a/resources/tester/test_294_1_chute_remove_pick.py +++ b/resources/tester/test_294_1_chute_remove_pick.py @@ -65,4 +65,9 @@ def test_형상_고름_길_그대로(): view = (ROOT / "B06_Section" / "B06_Section_UI_Cross_View.ts").read_text(encoding="utf-8") # 물넘이 콘크리트 · 맹암거 형상 누름 = 관 지점 고름 키 "pipe"(287-5) · 다시 누름 = 풂(toggle) assert 'shapePickRoute(svg, (at) => toggleRevet("pipe", at))' in view - assert 'setShapeActive(key === "pipe");' in view + # 형상 켬 = 키 "pipe" 이고 형상을 직접 누른 고름(307 — `splitPipePick` 로 옮김) + assert "splitPipePick(setRevetActive, setShapeActive, shapePicked)" in view + shape = (ROOT / "B06_Section" / "B06_Section_UI_Cross_Shape_Pick.ts").read_text( + encoding="utf-8" + ) + assert 'const shape = key === "pipe" && concrete();' in shape