aboutsummaryrefslogtreecommitdiff
path: root/internal/game/quit_casino_test.go
diff options
context:
space:
mode:
authorhistoria <[not public]>2026-09-18 05:31:09 -0400
committerhistoria <[not public]>2026-09-18 05:31:09 -0400
commit153acb7f644d755c45533b7c5311e3ffa47e8973 (patch)
tree7645e6f7b65bc3830b078e3b9336d2e6b199d584 /internal/game/quit_casino_test.go
parent87d08f0151e643951769e323995f1c5ed89ee200 (diff)
downloadthehouseoficarus-153acb7f644d755c45533b7c5311e3ffa47e8973.tar.gz
fix: harden engine across casino, economy, concurrency, security, and content
Diffstat (limited to 'internal/game/quit_casino_test.go')
-rw-r--r--internal/game/quit_casino_test.go8
1 files changed, 7 insertions, 1 deletions
diff --git a/internal/game/quit_casino_test.go b/internal/game/quit_casino_test.go
index 50f9ac8..f373457 100644
--- a/internal/game/quit_casino_test.go
+++ b/internal/game/quit_casino_test.go
@@ -169,7 +169,9 @@ func TestQuitMidRoundMentionsQuitNow(t *testing.T) {
// "quit now" starts the logout countdown while the player keeps their seat
// and wager; the stake is forfeited and the seat freed only on the final
-// tick, immediately before the disconnect.
+// tick, immediately before the disconnect. The round must be IN FLIGHT for
+// that: a stake placed in the betting window has had no card dealt for it and
+// is refunded on disconnect (see markDisconnected).
func TestQuitNowForfeitsOnlyAtLogout(t *testing.T) {
g, sess := quitTestGame(t)
sess.Account = &player.Account{Name: "alice"}
@@ -177,6 +179,10 @@ func TestQuitNowForfeitsOnlyAtLogout(t *testing.T) {
g.Casino.Join(1, cfg, "alice")
g.Casino.Join(1, cfg, "bob")
g.Casino.Bet(1, "blackjack", "alice", "", 10, casinoWallet{g: g, p: sess.Player})
+ // Bob bets too so the round actually starts and alice holds a dealt hand.
+ bobWallet := player.New("bob")
+ bobWallet.Credits = 1000
+ g.Casino.Bet(1, "blackjack", "bob", "", 10, casinoWallet{g: g, p: bobWallet})
wallet := sess.Player
g.doQuitNow(sess)