diff options
| author | historia <[not public]> | 2026-10-05 17:31:50 -0400 |
|---|---|---|
| committer | historia <[not public]> | 2026-10-05 17:31:50 -0400 |
| commit | 516fd29da423432ef6dfded21a984f1d15dcab1a (patch) | |
| tree | eb2dabe325a1335dedac28a93453df643ef986f2 /internal/casino/correct_audit_fixes_test.go | |
| parent | e42952469dadfb3535633c66c881050ac128703c (diff) | |
| download | thehouseoficarus-516fd29da423432ef6dfded21a984f1d15dcab1a.tar.gz | |
fix: slop casino and economy fixes
Diffstat (limited to 'internal/casino/correct_audit_fixes_test.go')
| -rw-r--r-- | internal/casino/correct_audit_fixes_test.go | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/internal/casino/correct_audit_fixes_test.go b/internal/casino/correct_audit_fixes_test.go new file mode 100644 index 0000000..e5e3bd3 --- /dev/null +++ b/internal/casino/correct_audit_fixes_test.go @@ -0,0 +1,23 @@ +package casino + +import ( + "math/rand" + "testing" +) + +// Regression: when the shooter leaves and others remain, the next shooter must +// start a fresh come-out rather than inheriting the previous point and +// made/seen bonus progress (which blocked line and bonus bets). +func TestCrapsShooterChangeResetsHand(t *testing.T) { + tb := newCrapsTable(1, TableConfig{ID: "craps", Game: GameCraps, BettingTicks: 2}, rand.New(rand.NewSource(7))) + tb.join("alice") + tb.join("bob") + tb.point = 6 + tb.rolled = true + tb.made = map[int]bool{4: true} + tb.seen = map[int]bool{4: true} + tb.remove("alice") + if tb.point != 0 || tb.rolled || len(tb.made) != 0 || len(tb.seen) != 0 { + t.Fatalf("new shooter inherited hand: point=%d rolled=%v made=%v seen=%v", tb.point, tb.rolled, tb.made, tb.seen) + } +} |
