⚠ **뿌리** — `tmp/` 는 창 사이에 안 건너감(실측 확인: 상대 창이 놓은 `tmp/_sync_probe.txt` 가 시간을 두고 두 번 봐도 안 보임). 그래서 **정본(등록부 스키마)만 건너가고 그것을 읽는 시험은 안 건너가** 오늘 두 번, 같은 시험이 **연 창은 통과·받은 창은 실패**가 됐음. - `tmp/tests/*` 를 `resources/tester/` 로 **복사**(127 파일). 내용은 **한 줄도 안 고침** - `tmp/tests` 는 **남겨 둠** — 되돌릴 자리(사용자 지시) - 실행: `./venv/Scripts/python.exe -m pytest resources/tester/ -q` 옮기기 전과 **같은 수**: 617 통과 / 22 건너뜀 / 실패 0 ⇒ 이제 시험·예외·까닭이 **정본과 함께** 움직임. 오늘 세운 「예외는 정본 스키마에」와 짝임. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
32 lines
1.4 KiB
JavaScript
32 lines
1.4 KiB
JavaScript
/* 곡선부 확폭 표 — 브라우저 짝이 파이썬과 같은 값을 내는지 확인(2026-09-06).
|
|
기대값은 `test_b06_curve_widening.py` 의 TABLE_CASES 와 같아야 한다. */
|
|
import assert from "node:assert/strict";
|
|
import { readFileSync } from "node:fs";
|
|
|
|
// TS 를 그대로 못 읽으므로 표·함수 부분만 떼어 평가한다(빌드 없이 도는 확인).
|
|
const source = readFileSync("common_util/common_util_cross_design_geometry.ts", "utf8");
|
|
const table = source.slice(
|
|
source.indexOf("const CURVE_WIDENING_TABLE_M"),
|
|
source.indexOf("/** 짝: `_SectionGeometry`"),
|
|
);
|
|
const js = table
|
|
.replace(/: ReadonlyArray<readonly \[number, number, number\]>/, "")
|
|
.replace(/export /g, "")
|
|
.replace(/: number \| null \| undefined/g, "")
|
|
.replace(/: number/g, "")
|
|
.replace(/planRadiusM\)/g, "planRadiusM)");
|
|
const { curveWideningM } = await import(
|
|
`data:text/javascript,${encodeURIComponent(js + "\nexport { curveWideningM, CURVE_WIDENING_MAX_WIDTH_M };")}`
|
|
);
|
|
|
|
const cases = [
|
|
[9.9, 0], [10, 2.25], [12.999, 2.25], [13, 2], [14, 1.75], [15, 1.5],
|
|
[18, 1.25], [20, 1], [25, 0.75], [30, 0.5], [40, 0.25], [45, 0], [200, 0],
|
|
];
|
|
for (const [radius, expected] of cases) {
|
|
assert.equal(curveWideningM(radius), expected, `R=${radius}`);
|
|
}
|
|
assert.equal(curveWideningM(null), 0);
|
|
assert.equal(curveWideningM(undefined), 0);
|
|
console.log("확폭표 브라우저 짝 일치 —", cases.length + 2, "건 확인");
|