Skip to content

Commit 6b58670

Browse files
committed
add some test cases and fix bug
1 parent 3bca51c commit 6b58670

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

mahjong/fan.h

+3
Original file line numberDiff line numberDiff line change
@@ -607,6 +607,9 @@ class Fan {
607607
_AddFan(FAN_SIGANG, {angang[0], angang[1], minggang[0], minggang[1]});
608608
_AddFan(FAN_SHUANGANKE, angang);
609609
break;
610+
case 130:
611+
_AddFan(FAN_SIGANG, {angang[0], minggang[0], minggang[1], minggang[2]});
612+
break;
610613
case 301:
611614
_AddFan(FAN_SANGANG, angang);
612615
_AddFan(FAN_SIANKE, {angang[0], angang[1], angang[2], anke[0]});

tools/unit_test.cpp

+4
Original file line numberDiff line numberDiff line change
@@ -313,6 +313,10 @@ void UnitTest() {
313313
//非九莲宝灯
314314
test("11134567889992p", vector<fan_t>{FAN_QINGYISE, FAN_MENQIANQING, FAN_SHUANGANKE, FAN_LIANLIU, FAN_YAOJIUKE, FAN_YAOJIUKE});
315315
test("[789p,1]11123456994p", vector<fan_t>{FAN_QINGYISE, FAN_LIANLIU, FAN_YAOJIUKE});
316+
//刻杠类
317+
test("[1111s][2222m][3333p,7][4444p]88s", vector<fan_t>{FAN_SIGANG, FAN_SANANKE, FAN_SANSESANJIEGAO, FAN_YAOJIUKE, FAN_WUZI});
318+
test("[1111s][2222m,2][3333p,7][4444p]88s", vector<fan_t>{FAN_SIGANG, FAN_SHUANGANKE, FAN_SANSESANJIEGAO, FAN_YAOJIUKE, FAN_WUZI});
319+
test("[1111s,1][2222m,2][3333p,7][4444p]88s", vector<fan_t>{FAN_SIGANG, FAN_SANSESANJIEGAO, FAN_YAOJIUKE, FAN_WUZI});
316320
}
317321

318322
int main() {

0 commit comments

Comments
 (0)