From 0d70bf4d5e4d8cb04091c8aaf69335318e0a9d6c Mon Sep 17 00:00:00 2001 From: TMC Date: Mon, 16 Nov 2026 19:27:50 +0100 Subject: [PATCH] Engine: test that over-cutting and going higher apply over the partner too Co-Authored-By: Claude Opus 5.5 --- .../jvmTest/kotlin/hr/bela/engine/PlayRulesTest.kt | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/engine/src/jvmTest/kotlin/hr/bela/engine/PlayRulesTest.kt b/engine/src/jvmTest/kotlin/hr/bela/engine/PlayRulesTest.kt index 4c910c2..833b790 100644 --- a/engine/src/jvmTest/kotlin/hr/bela/engine/PlayRulesTest.kt +++ b/engine/src/jvmTest/kotlin/hr/bela/engine/PlayRulesTest.kt @@ -75,6 +75,20 @@ class PlayRulesTest { assertEquals(setOf(c("KA")), legal(hand, "KK", "K8")) } + @Test + fun `must over-cut even the partner's cut`() { + // Seat 1 cuts, seat 3 (its partner) is out of the led suit and must cut higher. + val hand = cards("H7", "HJ", "PA") + assertEquals(setOf(c("HJ")), legal(hand, "KK", "HA", "P7")) + } + + @Test + fun `must go higher in trump even over the partner`() { + // Seat 0 leads a trump, seat 2 (its partner) must still go higher. + val hand = cards("HA", "HQ", "PA") + assertEquals(setOf(c("HA")), legal(hand, "HK", "H8")) + } + @Test fun `any card when out of the led suit and out of trumps`() { val hand = cards("PA", "T7")