diff options
| author | historia <[not public]> | 2026-10-02 17:51:46 -0400 |
|---|---|---|
| committer | historia <[not public]> | 2026-10-02 17:51:46 -0400 |
| commit | cac16d1725c46c82a2e62b84c93f7090b2ce0746 (patch) | |
| tree | e54f6624bdeb47421587656757ef3ce4fd7ebb3f /internal/casino/craps_test.go | |
| parent | 4f40f116ba884111c9a66849e620ff9fbc67530a (diff) | |
| download | thehouseoficarus-cac16d1725c46c82a2e62b84c93f7090b2ce0746.tar.gz | |
feat: craps table color improvements, die improvements
Diffstat (limited to 'internal/casino/craps_test.go')
| -rw-r--r-- | internal/casino/craps_test.go | 26 |
1 files changed, 21 insertions, 5 deletions
diff --git a/internal/casino/craps_test.go b/internal/casino/craps_test.go index 3d92e5e..7f3bcfa 100644 --- a/internal/casino/craps_test.go +++ b/internal/casino/craps_test.go @@ -5,7 +5,6 @@ import ( "math/rand" "strings" "testing" - "time" ) func crapsFixture() *crapsTable { @@ -227,6 +226,23 @@ func TestCrapsATSAndSevenReset(t *testing.T) { t.Fatal("late bonus allowed") } } + +// TestCrapsATSSeenTracksWithoutBonusBet: the Small/Tall tracker records every +// roll even when nobody holds an All/Small/Tall wager, so the display always +// shows progress and entices a bet. +func TestCrapsATSSeenTracksWithoutBonusBet(t *testing.T) { + tb := crapsFixture() + tb.join("a") + w := &testWallet{chips: 100} + tb.bet("a", "pass", 10, w) + tb.resolveRoll(2, 3) // point 5 + tb.resolveRoll(3, 3) // 6 + tb.resolveRoll(4, 4) // 8 + snap := tb.board("a").(*CrapsSnapshot) + if len(snap.Seen) != 3 { + t.Fatalf("ATS tracker did not track without a bonus bet: %v", snap.Seen) + } +} func TestCrapsTimersControlsAndRefunds(t *testing.T) { tb := crapsFixture() tb.join("a") @@ -237,7 +253,7 @@ func TestCrapsTimersControlsAndRefunds(t *testing.T) { if tb.dice != [2]int{} { t.Fatal("early roll") } - tb.tickElapsed(10 * time.Second) + tb.advance(10) if tb.phase != phasePlaying { t.Fatal(tb.phase) } @@ -253,7 +269,7 @@ func TestCrapsTimersControlsAndRefunds(t *testing.T) { if tb.dice != [2]int{} { t.Fatal("roll resolved before the shake") } - tb.tickElapsed(3 * time.Second) + tb.advance(3) if tb.dice == [2]int{} { t.Fatal("no roll") } @@ -261,12 +277,12 @@ func TestCrapsTimersControlsAndRefunds(t *testing.T) { tb.join("a") w = &testWallet{chips: 100} tb.bet("a", "pass", 10, w) - tb.tickElapsed(120 * time.Second) + tb.advance(120) if tb.dice != [2]int{} { t.Fatal("solo players must never be forced to roll") } tb.action("a", "roll") - tb.tickElapsed(3 * time.Second) + tb.advance(3) if tb.dice == [2]int{} { t.Fatal("solo manual roll stalled") } |
