1212
1313
1414class TestSuitsTable (unittest .TestCase ):
15- DP : ClassVar [list [int ]] = [0 ] * len (SUITS )
16-
17- @classmethod
18- def setUpClass (cls ) -> None :
19- for k in [5 , 6 , 7 , 8 , 9 ]:
20- cls .update_k (cls .DP , k )
21-
22- @staticmethod
23- def update_k (table : list [int ], k : int ) -> None :
15+ def check_suit_table_by_k (self , k : int ) -> None :
2416 iterable = list (range (k + 1 ))
2517 combs = combinations_with_replacement (iterable , 3 )
2618
@@ -33,19 +25,11 @@ def update_k(table: list[int], k: int) -> None:
3325 0x1 * cnts [0 ] + 0x8 * cnts [1 ] + 0x40 * cnts [2 ] + 0x200 * cnts [3 ]
3426 )
3527
36- # TODO(@ohwi): Check these cases:
37- # https://github.com/HenryRLee/PokerHandEvaluator/issues/93
38- # There exist three cases that idxes are same.
39- # For two different cnts in case of k=9.
40- # The cases are 72, 520, 576.
41- if idx in [72 , 520 , 576 ] and SUITS [idx ] != suit + 1 :
42- continue
43-
44- table [idx ] = suit + 1
28+ self .assertEqual (SUITS [idx ], suit + 1 )
4529
4630 def test_suits_table (self ) -> None :
47- self . assertListEqual ( self . DP , SUITS )
48-
31+ for k in [ 5 , 6 , 7 ]:
32+ self . check_suit_table_by_k ( k )
4933
5034class TestChooseTable (unittest .TestCase ):
5135 DP : ClassVar [list [list [int ]]] = [
0 commit comments