- packages/engine/betting: 한국식(체크·삥·콜·따당·쿼터·하프·풀·다이, 라운드당 1회·첫 행동에서만 레이즈),
노리밋·팟리밋(최소 레이즈, 불완전 올인 레이즈는 재오픈 안 함, BB 옵션), 앤티·블라인드, 올인,
받지 않은 베팅 반환, 사이드 팟 분할, 동점 분배(홀수 칩 순서), 시간 초과 자동 행동
- 테스트 24개: 포커·섯다 계획서 계산 예시, 행동별 상태 전이, 사이드 팟 예시, 무작위 베팅 1,500판
(칩 총량 보존·라운드 종료·라운드 끝 금액 일치·팟 합계=판 전체)
- packages/engine/cards: 트럼프 52+조커, 화투 48(+보너스)·섯다 20장 정의와 테스트
- 웹: 직접 그린 SVG 트럼프·화투 카드, 칩 표시("1,250 칩"), 놀이용 칩 안내문
- apps/web/src/no-money-wording.test.ts: 베팅 게임 화면에 통화 기호·"원"·판돈·충전·환전 등 금지
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
33 lines
1.6 KiB
TypeScript
33 lines
1.6 KiB
TypeScript
import { expect, test } from 'bun:test';
|
||
import { HWATU, SEOTDA_DECK, cardLabel, hwatu, hwatuBonus, rankValue, standardDeck } from './cards';
|
||
|
||
test('standard deck', () => {
|
||
const d = standardDeck(2);
|
||
expect(d).toHaveLength(54);
|
||
expect(new Set(d).size).toBe(54);
|
||
expect(rankValue('AS')).toBe(14);
|
||
expect(rankValue('2C')).toBe(2);
|
||
expect(cardLabel('TD')).toBe('◆10');
|
||
expect(cardLabel('X1')).toBe('조커');
|
||
});
|
||
|
||
test('hwatu composition matches gostop.md §3.1', () => {
|
||
expect(HWATU).toHaveLength(48);
|
||
const count = (k: string) => HWATU.filter((c) => c.kind === k).length;
|
||
expect([count('gwang'), count('yeol'), count('tti'), count('pi') + count('ssangpi')]).toEqual([5, 9, 10, 24]);
|
||
expect(HWATU.filter((c) => c.kind === 'ssangpi').map((c) => c.id)).toEqual([41, 47]);
|
||
expect(HWATU.filter((c) => c.tags.includes('godori')).map((c) => c.id)).toEqual([4, 12, 29]);
|
||
expect(hwatu(32).tags).toContain('gukjin');
|
||
expect(hwatu(44).name).toBe('12월 비광(비)');
|
||
expect(HWATU.every((c) => c.month === Math.floor(c.id / 4) + 1)).toBe(true);
|
||
expect(hwatuBonus(3).map((c) => c.piValue)).toEqual([2, 2, 3]);
|
||
});
|
||
|
||
test('seotda deck: 20 cards, months 1–10 twice, 광 1·3·8, 열끗 4·7·9 specials', () => {
|
||
expect(SEOTDA_DECK).toHaveLength(20);
|
||
const months = SEOTDA_DECK.map((id) => hwatu(id).month).sort((a, b) => a - b);
|
||
expect(months).toEqual([1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10]);
|
||
expect(SEOTDA_DECK.filter((id) => hwatu(id).kind === 'gwang').map((id) => hwatu(id).month)).toEqual([1, 3, 8]);
|
||
expect([12, 24, 32].every((id) => SEOTDA_DECK.includes(id) && hwatu(id).kind === 'yeol')).toBe(true);
|
||
});
|