- 옮김: B04 2 · B05 23 · B06 11 · A00_Common/design 13 (9,299 줄) · 이미 logic/ 에 있던 16 파일 그대로 - 안 옮김: 묶음 입구(package.json build:*) · 파이썬 · 순수지만 계산 아닌 8 (보기 결선 · 콜백 · API 타입 · 갈아끼움 알림판) - import 266 줄(142 파일) · 시험 · 주석 · 짝 표시 문자열 경로 고침 · B05 · B06 CLAUDE.md 짝 줄 logic/ - 시험 도우미 새 경로: 가짜 require 열쇠 · B05()/B06() 부름 · 형제 import 자리 · tsc 묶어 돌리는 시험 · 정규식 · rglob - design_view_cross 줄 한도 시험 685 → 688 (긴 import 경로 줄바꿈 3줄) - 확인: typecheck 0 · 서버 묶음 넷(corridor · server-calc · b07-extent · b07-note) 다시 지어 코드 같음(//#region 경로 주석만 다름) · 관련 시험 270 파일 — 남은 실패 19 는 옮기기 전과 같음 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014utrjfoW831Vc5wJUd13kL
38 lines
1.4 KiB
JavaScript
38 lines
1.4 KiB
JavaScript
/* 구조물 측점과 겹치는 규칙 측점 제거 — 2026-09-06.
|
|
TS 를 프로젝트 tsc 로 옮겨 실제 코드를 그대로 돌린다. */
|
|
import assert from "node:assert/strict";
|
|
import { execFileSync } from "node:child_process";
|
|
import { mkdtempSync } from "node:fs";
|
|
import { tmpdir } from "node:os";
|
|
import { join } from "node:path";
|
|
import { pathToFileURL } from "node:url";
|
|
|
|
const out = mkdtempSync(join(tmpdir(), "aislo-station-"));
|
|
execFileSync(
|
|
process.execPath,
|
|
[
|
|
"./config/node_modules/typescript/bin/tsc",
|
|
"B05_Profile/logic/B05_Profile_Util_Station.ts",
|
|
"--outDir", out,
|
|
"--module", "esnext", "--target", "es2022", "--moduleResolution", "bundler", "--ignoreConfig",
|
|
],
|
|
{ stdio: "inherit" },
|
|
);
|
|
const { dropStationsNear, STATION_MERGE_TOLERANCE_M } = await import(
|
|
pathToFileURL(join(out, "B05_Profile_Util_Station.js")).href
|
|
);
|
|
|
|
const regular = [0, 20, 40, 60, 80].map((chainage_m) => ({ chainage_m, kind: "regular" }));
|
|
const structures = [{ chainage_m: 40.05 }, { chainage_m: 63.0 }];
|
|
const kept = dropStationsNear(regular, structures);
|
|
|
|
assert.deepEqual(
|
|
kept.map((s) => s.chainage_m),
|
|
[0, 20, 60, 80],
|
|
"0.1m 안에서 겹친 40m 규칙 측점만 빠져야 한다",
|
|
);
|
|
assert.equal(STATION_MERGE_TOLERANCE_M, 0.1);
|
|
// 구조물이 없으면 아무것도 지우지 않는다.
|
|
assert.equal(dropStationsNear(regular, []).length, regular.length);
|
|
console.log("OK — 구조물 측점과 겹친 규칙 측점만 제거");
|