fix(B09 단가 덮개): TS 이름 겹침(PARTS → COVER_PARTS) · 내역 거울 시험 글을 stdin 으로 (PLAN 707-3)

test_145_3 블록 나누기 시험 — Calc_Base.ts 가 길어져 node -e 명령 줄이 Windows 32 K 를 넘음 · 같은 글을 stdin 으로 넘김(판정 그대로).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-31 15:41:17 +09:00
co-authored by Claude Opus 5.5
parent 39e0ee6d85
commit 0b2330aee6
2 changed files with 6 additions and 6 deletions
+4 -4
View File
@@ -44,7 +44,7 @@ export const SOURCES = [
/** 자재 줄 사용자 표시 */
export const SUPPLY = ["관급", "별도"] as const;
const PARTS = ["labor", "material", "expense"] as const;
const COVER_PARTS = ["labor", "material", "expense"] as const;
function scaled(value: number, places: number, fn: (x: number) => number): number {
const a = Math.abs(value);
@@ -121,8 +121,8 @@ export function machineCover(cover: unknown): Row {
const out: Row = {};
for (const [key, cell] of Object.entries(cover && typeof cover === "object" ? cover : {})) {
const got: Row = {};
for (const p of PARTS) got[p] = cell && typeof cell === "object" ? num(cell[p]) : null;
if (PARTS.every((p) => got[p] !== null)) out[key] = got;
for (const p of COVER_PARTS) got[p] = cell && typeof cell === "object" ? num(cell[p]) : null;
if (COVER_PARTS.every((p) => got[p] !== null)) out[key] = got;
}
return out;
}
@@ -310,7 +310,7 @@ export function computeBase(inputs: Row, user: Row): Row {
if (!(b.key in covers)) continue; // 707-3 덮개 = 비목 합 · 합(줄은 그대로)
b.book = { labor: b.labor, material: b.material, expense: b.expense, sum: b.sum };
Object.assign(b, covers[b.key], { covered: true });
b.sum = total(PARTS.map((p) => b[p]));
b.sum = total(COVER_PARTS.map((p) => b[p]));
}
gaps = gaps.filter((g) => !(g.tab === "machine_blocks" && g.key in covers));
const machine = blocks.map((b: Row, i: number) => ({
+2 -2
View File
@@ -248,8 +248,8 @@ def test_거울_블록_나누기():
)
result = subprocess.run(
["node", "--experimental-strip-types", "--no-warnings",
"--input-type=module-typescript", "-e", calc + body],
capture_output=True, text=True, encoding="utf-8", timeout=60,
"--input-type=module-typescript"], # 글은 stdin — 명령 줄 32 K 넘김(Windows)
input=calc + body, capture_output=True, text=True, encoding="utf-8", timeout=60,
) # fmt: skip
assert result.returncode == 0, result.stderr
assert json.loads(result.stdout) == compute_estimation(SPLIT_INPUTS, USER, DAEGA.get)