From 622fc44645d726e7ee82379772dc53321d2d1aa6 Mon Sep 17 00:00:00 2001 From: im_tan Date: Mon, 12 Feb 2024 09:06:00 +0900 Subject: [PATCH] add kokushi test (#13262) --- packages/misskey-mahjong/test/yaku.ts | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/packages/misskey-mahjong/test/yaku.ts b/packages/misskey-mahjong/test/yaku.ts index 835ac1b5b8..6cbfbf100a 100644 --- a/packages/misskey-mahjong/test/yaku.ts +++ b/packages/misskey-mahjong/test/yaku.ts @@ -18,6 +18,26 @@ describe('Yaku', () => { }); }); + describe('kokushi', () => { + it('valid', () => { + assert.deepStrictEqual(calcYakus({ + house: 'e', + handTiles: ['m1', 'm9', 's1', 's9', 'p1', 'p9', 'haku', 'hatsu', 'chun', 'n', 'w', 's', 'e'] , + huros: [], + tumoTiles: 'm1', + }), ['kokushi']); + }); + it('invalid', () => { + assert.deepStrictEqual(calcYakus({ + house: 'e', + handTiles: ['m1', 'm9', 's1', 's9', 'p1', 'p9', 'haku', 'hatsu', 'chun', 'n', 'w', 's', 'e', 'm3'] , + huros: [], + tumoTiles: 'm3', + }).includes('kokushi'), false); + }); + }); + + describe('churen', () => { it('valid', () => { assert.deepStrictEqual(calcYakus({