From 1f118d79e319da4e765502e9ca5b661772de94f1 Mon Sep 17 00:00:00 2001 From: historia <[not public]> Date: Fri, 18 Sep 2026 18:38:35 -0400 Subject: refactor: casino table core; fix: stake/migration/validation gaps --- internal/game/sys_safespot_state_test.go | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 internal/game/sys_safespot_state_test.go (limited to 'internal/game/sys_safespot_state_test.go') diff --git a/internal/game/sys_safespot_state_test.go b/internal/game/sys_safespot_state_test.go new file mode 100644 index 0000000..2976bce --- /dev/null +++ b/internal/game/sys_safespot_state_test.go @@ -0,0 +1,19 @@ +package game + +import "testing" + +// TestSafespotManagerRekeyRooms: a live room rename must remap the room ID +// stored on an active safespot, or the safespot lookup misses and the player +// is force-ejected from cover. +func TestSafespotManagerRekeyRooms(t *testing.T) { + m := NewSafespotManager() + m.Set("alice", SafespotState{Active: true, ObjectDefID: "bush", RoomID: 5}) + m.Set("bob", SafespotState{Active: true, ObjectDefID: "rock", RoomID: 9}) + m.RekeyRooms(map[int]int{5: 7}) + if ss, _ := m.Get("alice"); ss.RoomID != 7 { + t.Fatalf("alice safespot room = %d, want 7", ss.RoomID) + } + if ss, _ := m.Get("bob"); ss.RoomID != 9 { + t.Fatalf("bob safespot room = %d, want 9 (unchanged)", ss.RoomID) + } +} -- cgit v1.2.3