From 62017c86392b046d746fb4fafef6742840477c5f Mon Sep 17 00:00:00 2001 From: historia <[not public]> Date: Fri, 2 Oct 2026 02:16:44 -0400 Subject: feat: polish 'list' output, drop sitout command --- internal/net/server_test.go | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'internal/net/server_test.go') diff --git a/internal/net/server_test.go b/internal/net/server_test.go index da8084a..6a3b376 100644 --- a/internal/net/server_test.go +++ b/internal/net/server_test.go @@ -99,6 +99,21 @@ func (c *fakeNetConn) readDeadline() time.Time { return c.deadline } +// TestEnterRoomClearsCasinoWatch: detailed table watch is scoped to the room +// it was set in, so entering a room stops a stale watch instead of silently +// resuming it when the player returns. +func TestEnterRoomClearsCasinoWatch(t *testing.T) { + h := NewHub() + s := &Session{} + h.Add(s) + s.CasinoWatchRoom = 7 + s.CasinoWatchTable = "bj1" + h.EnterRoom(s, 9) + if s.CasinoWatchRoom != 0 || s.CasinoWatchTable != "" { + t.Fatalf("watch survived a room change: room=%d table=%q", s.CasinoWatchRoom, s.CasinoWatchTable) + } +} + // TestConnectionCapRefusalKeepsTheServerDrained: at maxConnections a new // connection is refused without holding a slot (the counter stays at the cap), // and the refused peer is told why. Once the admitted sessions end, the live -- cgit v1.2.3