// node tools/line-stack-test/check.mjs — 견본 셋 금액 = 거창 출력 숫자(원 단위) import { compute } from "./calc.js"; import { SAMPLES } from "./samples.js"; let bad = 0; for (const s of SAMPLES.filter((x) => x.expect)) { const { tot, errors } = compute(s.doc); const ok = ["l", "m", "e", "sum"].every((c) => tot[c] === s.expect[c]) && !errors.length; if (!ok) bad++; console.log(ok ? "같음" : "다름", s.label, JSON.stringify(tot), errors.join(" ")); } process.exit(bad ? 1 : 0);