"""500-1 B05 평면 — 곡선(교각점 · 손잡이 · 호) 누름 = 측점 고름 유지 · 풀림 = 오른쪽 판도 비움 · 임시 횡단 창 단추 = 제목 줄 · 제목 줄 끌기. ./venv/Scripts/python.exe -m pytest resources/tester/test_500_1_curve_keeps_pick.py -q """ from __future__ import annotations from pathlib import Path ROOT = Path(__file__).resolve().parents[2] def _read(*parts: str) -> str: return ROOT.joinpath(*parts).read_text(encoding="utf-8") def _down() -> str: """평면 누름 — 마커 갈래 뒤 ~ 교각점 갈래 앞.""" pointer = _read("B05_Profile", "B05_Profile_UI_RouteEdit_Pointer.ts") start = pointer.index("if (choice.mark && marks.press(px, py)) {") return pointer[start : pointer.index("if (hitNode >= 0) {", start)] # 누름별 — 고름 유지(풂 건너뜀) 조건 한 줄씩 KEEP = { "교각점": '(!!pick && "node" in pick)', "손잡이": "choice.handle !== null", "호(눈금 아님)": '(!(pick && "chainage" in pick) && arcAtScreen(state.curveInfo, toScreen, px, py) >= 0)', } def test_곡선_누름은_고름_유지() -> None: down = _down() for name, cond in KEEP.items(): assert cond in down, name assert "if (!onCurve) marks.deselect();" in down # 그 밖(빈 땅 · 등고선 · 눈금) = 풂 assert down.count("marks.deselect()") == 1 # 무조건 풂 걷힘 def test_차례_마커_다음_교각점_앞() -> None: down = _down() assert down.index("canvas.setPointerCapture(event.pointerId);") < down.index("const onCurve") assert down.index("const onCurve") < down.index("if (!onCurve) marks.deselect();") def test_풀림은_오른쪽_판도_비움() -> None: cross = _read("B05_Profile", "B05_Profile_UI_RouteEdit_Cross.ts") line = "if (from !== PLAN_PICK_FROM || selection.chainageM === null) follow(selection);" assert line in cross follow = cross[cross.index("function follow(") : cross.index(line)] assert "watching = null;" in follow and "current.show(null, interval());" in follow # 풂(값 없음 · 평면 이름)을 내는 곳 = 마커 풂 하나 · Esc 도 같은 길 marks = _read("B05_Profile", "B05_Profile_UI_RouteEdit_StructureMarks.ts") assert marks.count("selectDesign(projectId, NO_SELECTION, { from: PLAN_PICK_FROM });") == 1 assert "!activeMoving(canvas) && deselect()" in marks def test_임시_횡단_단추_제목_줄_오른쪽() -> None: modal = _read("B05_Profile", "B05_Profile_UI_Profile_CrossModal.ts") head = modal[ modal.index('