diff --git a/B09_Estimation/B09_Estimation_Calc_Base.ts b/B09_Estimation/B09_Estimation_Calc_Base.ts index d2e77ad7d..011b21db0 100644 --- a/B09_Estimation/B09_Estimation_Calc_Base.ts +++ b/B09_Estimation/B09_Estimation_Calc_Base.ts @@ -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) => ({ diff --git a/resources/tester/test_145_3_b09_bill.py b/resources/tester/test_145_3_b09_bill.py index f18b74948..e853a191a 100644 --- a/resources/tester/test_145_3_b09_bill.py +++ b/resources/tester/test_145_3_b09_bill.py @@ -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)