Disclosure: This draft was generated with AI. The test cases below can be reproduced without playing for money.

A royal flush fixture tells you very little. An implementation can pass it while mishandling the low ace, reading only the first five cards, or using suits as a tiebreaker. Known examples still matter, but valid transformations let you check many more inputs without working out each answer by hand.

Separate the evaluator from the equity calculator. A Hold’em evaluator ranks a known seven-card set using its strongest five cards. An equity calculator supplies possible missing community cards, compares each player’s rank and aggregates the outcomes. Test the ranking layer first.

Three transformations that should preserve meaning

  1. Permute card order. A seven-card set and any reordered copy must produce the same rank. Use a fixed test seed so failures are replayable.
  2. Rename suits bijectively. Apply one consistent permutation of all four suits. Changing the suit of individual cards independently does not preserve this property.
  3. Swap players on a complete board. A win becomes a loss; a tie stays a tie. Use nine distinct cards.

An implementation that always returns “tie” could pass all three. Pair the invariants with an independent, slower reference: enumerate the 21 five-card subsets, rank them with a simple classifier, and take the strongest. Write that classifier independently; sharing the optimized evaluator’s straight detector could let the same bug pass both sides.

Seed the suite with edge cases

  • Ace-low straight: A♣ 2♦ 3♠ 4♥ 5♣ K♦ Q♥ is five-high. Replace Q♥ with 6♥ and it becomes six-high.
  • Two triplets: A♣ A♦ A♥ K♣ K♦ K♥ 2♠ makes aces full of kings.
  • The board plays: board A♣ K♦ Q♠ J♥ T♣; hole cards 2♠ 3♠ versus 8♦ 9♦. Both players have the same ace-high straight.

The last example can serve as a black-box check in the 3BetLab equity calculator, a tool I develop. Enter the complete board and both hands. The tie rate should be 100%; each player’s pot share should be 50%. Separating those two numbers catches a different family of mistakes from hand ranking.