Skip to content

Commit ee65a27

Browse files
dstocktoDavid Stockton
andauthored
Add new test cases for Poker (#2001)
* Add new test case for Poker Ensures ranking based on adding pair values with equal weight does not erroneously rank different two-pair hands as equivalent. * Add another case for two-pairs Pair face value sums are opposite of which wins: The lower sum of the two pairs wins because it contains the highest single pair Co-authored-by: David Stockton <[email protected]>
1 parent 32100ab commit ee65a27

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

exercises/poker/canonical-data.json

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,24 @@
9696
},
9797
"expected": ["JD QH JS 8D QC"]
9898
},
99+
{
100+
"uuid": "f761e21b-2560-4774-a02a-b3e9366a51ce",
101+
"description": "both hands have two pairs that add to the same value, win goes to highest pair",
102+
"property": "bestHands",
103+
"input": {
104+
"hands": ["6S 6H 3S 3H AS", "7H 7S 2H 2S AC"]
105+
},
106+
"expected": ["7H 7S 2H 2S AC"]
107+
},
108+
{
109+
"uuid": "fc6277ac-94ac-4078-8d39-9d441bc7a79e",
110+
"description": "two pairs first ranked by largest pair",
111+
"property": "bestHands",
112+
"input": {
113+
"hands": ["5C 2S 5S 4H 4C", "6S 2S 6H 7C 2C"]
114+
},
115+
"expected": ["6S 2S 6H 7C 2C"]
116+
},
99117
{
100118
"uuid": "21e9f1e6-2d72-49a1-a930-228e5e0195dc",
101119
"description": "three of a kind beats two pair",

0 commit comments

Comments
 (0)