aboutsummaryrefslogtreecommitdiff
path: root/internal/net/server_test.go
diff options
context:
space:
mode:
authorhistoria <[not public]>2026-10-02 02:16:44 -0400
committerhistoria <[not public]>2026-10-02 02:16:44 -0400
commit62017c86392b046d746fb4fafef6742840477c5f (patch)
treeeab569e29e858ff79b8ce06caa9bacb28bc9ee81 /internal/net/server_test.go
parentd3a305d1d7962f82af2397760cf8008758bddd1d (diff)
downloadthehouseoficarus-62017c86392b046d746fb4fafef6742840477c5f.tar.gz
feat: polish 'list' output, drop sitout command
Diffstat (limited to 'internal/net/server_test.go')
-rw-r--r--internal/net/server_test.go15
1 files changed, 15 insertions, 0 deletions
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