Files
Pier_v1/tests/rebar-common.test.ts
T
CopilotandCopilot 06e1b97a62
ITAM Code Check / build-and-config-check (push) Failing after 37s
ITAM Docker Build Check / docker-build-check (push) Failing after 1m0s
교각 프로그램 초기 버전
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-11-02 15:55:01 +09:00

34 lines
1.5 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import { describe, expect, it } from 'vitest';
import { developmentLength, hookLength, MATERIAL_DEFAULTS, spliceLength } from '../src/core/rebar/common';
describe('③ 공통 규칙 (spec §6.2, plan C1)', () => {
it('fck and fy defaults are assumed values (I02)', () => {
expect(MATERIAL_DEFAULTS.fck).toBe(27);
expect(MATERIAL_DEFAULTS.fy.H).toBe(400);
expect(MATERIAL_DEFAULTS.fy.S).toBe(500);
expect(MATERIAL_DEFAULTS.assumed).toBe(true);
});
it('development length follows l_d = 0.6·d_b·fy/(λ·√fck)', () => {
// H19, SD400, fck 27: 0.6 × 19 × 400 / √27
expect(developmentLength(19, 400, 27)).toBeCloseTo((0.6 * 19 * 400) / Math.sqrt(27), 9);
expect(developmentLength(19, 400, 27)).toBeCloseTo(877.6, 0);
});
it('splice length is 1.3 × l_d', () => {
expect(spliceLength(19, 400, 27)).toBeCloseTo(1.3 * developmentLength(19, 400, 27), 9);
});
it('hook lengths: main bars D25 or less 15.5 d_b, D29–D35 16.5 d_b; ties D16 or less 8.5 d_b', () => {
expect(hookLength('main90', 25)).toBeCloseTo(15.5 * 25, 9);
expect(hookLength('main90', 29)).toBeCloseTo(16.5 * 29, 9);
expect(hookLength('tie90', 16)).toBeCloseTo(8.5 * 16, 9);
expect(() => hookLength('main90', 40)).toThrow('없는 지름');
expect(() => hookLength('tie90', 19)).toThrow('없는 지름');
});
it('135° stirrup hook as written in the spec: 2.5·d_b·(3π/4) + 6·d_b', () => {
expect(hookLength('stirrup135', 16)).toBeCloseTo(2.5 * 16 * ((3 * Math.PI) / 4) + 6 * 16, 9);
});
});