"""측점 표기는 **한 벌**이다 — 토적표와 구조물 원단위가 같은 함수를 쓴다 (2026-09-09). 구조물 줄에 구간 표기(`NO.4 ~ NO.4+10`)를 붙였다(계획서 V-8). 표기를 각자 만들면 같은 측점이 화면 두 곳에서 다르게 적히므로 `stationLabel` 하나를 내보내 쓴다. ⚠ 길이와 갈리지 않는 것이 요점이다 — 구간은 `start_m`·`end_m` 에서 나오고 `length_m` 은 그 구간(겹침을 지운 목록)의 합이라 두 값이 어긋날 자리가 없다. """ from __future__ import annotations from pathlib import Path ROOT = Path(__file__).resolve().parents[2] EARTHWORK = ROOT / "B08_Quantity" / "B08_Quantity_UI_EarthworkGrid.ts" MATERIAL = ROOT / "B08_Quantity" / "B08_Quantity_UI_MaterialGrid.ts" def test_표기_함수가_한_벌이다() -> None: assert "export function stationLabel" in EARTHWORK.read_text(encoding="utf-8") material = MATERIAL.read_text(encoding="utf-8") assert 'import { stationLabel } from "./B08_Quantity_UI_EarthworkGrid"' in material assert "function stationLabel" not in material, "표기 함수를 두 벌로 만들었다" def test_구간은_구조물_값에서_나온다() -> None: """지어낸 측점이 아니라 `start_m`·`end_m` 을 그대로 쓴다.""" material = MATERIAL.read_text(encoding="utf-8") assert "stationRange(structure.start_m, structure.end_m)" in material assert "start_m?: number | null" in material