# -*- coding: utf-8 -*- """433-19 · 433-20 — 구간값 죽은 길 걷음 · 표 위 CAD 요소 한도(서버 2000 짝). 못박는 것 - 구간값 제어에 기준벽 `update`(culvertopt 큐 쓰기) 없음 · 구간 줄은 다단 벽만(444 관 초안 한 벌). - 표 위 CAD 한도 = 서버 `CrossNoteCad.entities max_length` · 넘으면 초안에 안 쓰고 알림. """ import re from pathlib import Path ROOT = Path(__file__).resolve().parents[2] B06 = ROOT / "B06_Section" def _read(name: str) -> str: return (B06 / name).read_text(encoding="utf-8") def test_구간값_제어에_culvertopt_큐_쓰기_없음(): span = _read("B06_Section_UI_Page_Span_Control.ts") assert "culvertOptions" not in span assert "update: (section, role" not in span wire = _read("logic/B06_Section_Cross_Culvert_Wire.ts") assert not re.search(r"^\s*update: \(section: CrossSection, role", wire, re.M) view = _read("B06_Section_UI_Cross_View_Structure.ts") assert "structureSpan?.update(" not in view def test_CAD_한도_서버와_같음(): schema = _read("B06_Section_Schema.py") server = re.search( r"class CrossNoteCad\(BaseModel\):.*?entities:.*?max_length=(\d+)", schema, re.S ) cad = _read("B06_Section_UI_Cross_Detail_Cad.ts") screen = re.search(r"NOTE_CAD_MAX_ENTITIES = (\d+)", cad) assert server and screen and server.group(1) == screen.group(1) def test_CAD_한도_넘으면_초안에_안_씀(): cad = _read("B06_Section_UI_Cross_Detail_Cad.ts") body = cad[cad.index("function writeNoteCad(") :] guard = body.index("NOTE_CAD_MAX_ENTITIES") assert guard < body.index("structure_note_cad = cad") assert "showToast(" in body[guard : body.index("structure_note_cad = cad")]