aboutsummaryrefslogtreecommitdiff
path: root/internal/game/content_refs_test.go
blob: 456a0ee6c5191c36b76017f9da534be7ac470a46 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
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)
		}
	}
}