From 1dad15698845d370e998f7cc5feb8aece3fab58f Mon Sep 17 00:00:00 2001 From: historia <[not public]> Date: Wed, 16 Sep 2026 17:05:17 -0400 Subject: refactor: remove dead code, consolidate save/error handling, add lint gate --- internal/game/quit_casino_test.go | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'internal/game/quit_casino_test.go') diff --git a/internal/game/quit_casino_test.go b/internal/game/quit_casino_test.go index f055e07..f905fca 100644 --- a/internal/game/quit_casino_test.go +++ b/internal/game/quit_casino_test.go @@ -37,8 +37,8 @@ func quitTestGame(t *testing.T) (*Game, *net.Session) { return g, sess } -func (g *Game) quitResting(name string) bool { - _, ok := g.restTimers[name] +func (g *Game) quitResting() bool { + _, ok := g.restTimers["alice"] return ok } @@ -63,7 +63,7 @@ func TestQuitBlockedMidRoundKeepsWager(t *testing.T) { if _, playing := g.Casino.Participation("alice"); !playing { t.Fatal("quit mid-round removed the player from the table") } - if g.quitResting("alice") { + if g.quitResting() { t.Fatal("blocked quit started the rest countdown") } // The stake is still committed to the round, not refunded. @@ -90,7 +90,7 @@ func TestQuitBlockedMidRoundBaccarat(t *testing.T) { if _, playing := g.Casino.Participation("alice"); !playing { t.Fatal("quit mid-round removed the player from the baccarat table") } - if g.quitResting("alice") { + if g.quitResting() { t.Fatal("blocked quit started the rest countdown") } } @@ -111,7 +111,7 @@ func TestQuitLeavesTableBetweenRounds(t *testing.T) { if _, playing := g.Casino.Participation("alice"); playing { t.Fatal("quit did not free the table seat") } - if !g.quitResting("alice") { + if !g.quitResting() { t.Fatal("quit did not start the rest countdown") } } @@ -129,7 +129,7 @@ func TestQuitLeavesMachine(t *testing.T) { if _, playing := g.Casino.Participation("alice"); playing { t.Fatal("quit did not free the machine") } - if !g.quitResting("alice") { + if !g.quitResting() { t.Fatal("quit did not start the rest countdown") } if strings.Contains(string(conn.data), "WARNING") { @@ -145,7 +145,7 @@ func TestStopCancelsQuit(t *testing.T) { g.executeStop(sess, nil, "stop") - if g.quitResting("alice") { + if g.quitResting() { t.Fatal("stop did not cancel the pending quit") } } @@ -185,7 +185,7 @@ func TestQuitNowForfeitsOnlyAtLogout(t *testing.T) { if _, playing := g.Casino.Participation("alice"); !playing { t.Fatal("quit now freed the seat before the logout tick") } - if !g.quitResting("alice") { + if !g.quitResting() { t.Fatal("quit now did not start the rest countdown") } @@ -210,7 +210,7 @@ func TestQuitNowForfeitsOnlyAtLogout(t *testing.T) { if _, stillLoggedIn := g.loggedInChars["alice"]; stillLoggedIn { t.Fatal("quit now did not remove the session from the logged-in map") } - if g.quitResting("alice") { + if g.quitResting() { t.Fatal("countdown timer was not cleared after logout") } } @@ -227,7 +227,7 @@ func TestQuitNowCancelledByStopMidRound(t *testing.T) { g.doQuitNow(sess) g.executeStop(sess, nil, "stop") - if g.quitResting("alice") { + if g.quitResting() { t.Fatal("stop did not cancel the pending quit-now countdown") } if _, playing := g.Casino.Participation("alice"); !playing { -- cgit v1.2.3