import { readFileSync } from 'node:fs'; import { fileURLToPath } from 'node:url'; import * as XLSX from 'xlsx'; import { describe, expect, it } from 'vitest'; import { abutSummaryRows } from '../src/core/abut/summary'; import { parseAbutments } from '../src/core/abut/parse'; const RAG = fileURLToPath(new URL('../../../RAG/운곡교P1입력.xlsx', import.meta.url)); const rec = parseAbutments(XLSX.read(readFileSync(RAG), { type: 'buffer' })).abutments[0]; const rows = new Map(abutSummaryRows(rec)); describe('교대 상세 (삽도 항목, spec_abut §10.1)', () => { it('the 삽도 values of A1: 저판 상면 41.995, 벽체 2.372 m, 브라켓 상면 46.843, 흉벽 상단 48.006 (IP1 끝) / 47.661 (IP3 끝)', () => { expect(rows.get('저판 상면 EL')).toBe('41.995 m'); expect(rows.get('벽체 높이 (구간 ①)')).toBe('2.372 m'); expect(rows.get('브라켓 상면 EL (구간 ①)')).toBe('46.843 m'); expect(rows.get('흉벽 상단 EL (IP1 끝 / IP3 끝)')).toBe('48.006 / 47.661 m'); }); it('the piles, joints, 접속슬래브 width and 받침블럭 height match the spec: 18 piles, tip 19.295, 1 joint, 11253 mm, 125 mm', () => { expect(rows.get('말뚝 (열 × 본수)')).toBe('3 × 6 = 18 본'); expect(rows.get('말뚝 선단 EL')).toBe('19.295 m'); expect(rows.get('수축줄눈 (ceil(L/10) − 1)')).toBe('1 개'); // 11.2535 m exactly (450 / sin Δ + 20 per wing); rounding to mm gives 11253 or 11254. expect(Math.abs(parseInt(String(rows.get('접속슬래브 폭')), 10) - 11253)).toBeLessThanOrEqual(1); expect(rows.get('받침블럭 높이 (패드 포함)')).toBe('125 mm'); }); it('the 계단 경계 from IP3 are 2.395 · 4.905 · 7.415 · 9.924 m', () => { expect(rows.get('계단 경계 (IP3 쪽에서)')).toBe('2.395 / 4.905 / 7.415 / 9.924 m'); }); });