diff options
Diffstat (limited to 'internal/game/content_refs_test.go')
| -rw-r--r-- | internal/game/content_refs_test.go | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/internal/game/content_refs_test.go b/internal/game/content_refs_test.go new file mode 100644 index 0000000..456a0ee --- /dev/null +++ b/internal/game/content_refs_test.go @@ -0,0 +1,21 @@ +package game + +import ( + "path/filepath" + "testing" + + "thehouseoficarus/internal/world" +) + +// TestCodeReferencedRoomsExist guards the literal room IDs in content_refs.go. +// If one of those rooms is moved or deleted, the thief-jail and +// estate-directory teleports would silently soft-lock players, so the shipped +// data must still contain them. +func TestCodeReferencedRoomsExist(t *testing.T) { + w := world.New(filepath.Join("..", "..", "data")) + for _, id := range []int{jailRoomID, estateNeighborhoodID} { + if _, err := w.LoadRoom(id); err != nil { + t.Errorf("code-referenced room %d is missing from data/rooms: %v", id, err) + } + } +} |
