aboutsummaryrefslogtreecommitdiff
path: root/internal/world/room_test.go
diff options
context:
space:
mode:
authorhistoria <[not public]>2026-06-28 02:40:30 -0400
committerhistoria <[not public]>2026-06-28 02:40:30 -0400
commita1b6613c6c6a2f8d6e1ecd47e766bd40f92ac295 (patch)
tree4ff8fefb029c93f2aa3db7361658b0b4e9805b66 /internal/world/room_test.go
parent87dacfbb3dd16e7f55a82361eace98f9a39d75c8 (diff)
downloadthehouseoficarus-a1b6613c6c6a2f8d6e1ecd47e766bd40f92ac295.tar.gz
feat: admin accounts, god mode, OLC commands like dig/room, 'inline' objects changed to 'local' objects
Diffstat (limited to 'internal/world/room_test.go')
-rw-r--r--internal/world/room_test.go34
1 files changed, 17 insertions, 17 deletions
diff --git a/internal/world/room_test.go b/internal/world/room_test.go
index 472fe4f..e7b1718 100644
--- a/internal/world/room_test.go
+++ b/internal/world/room_test.go
@@ -18,7 +18,7 @@ func writeRoom(t *testing.T, dir string, body string) {
}
}
-func TestRoomObjectReferenceVsInline(t *testing.T) {
+func TestRoomObjectReferenceVsLocal(t *testing.T) {
dir := t.TempDir()
body := `name: Test Room
objects:
@@ -44,37 +44,37 @@ objects:
}
// reference
- if ref := room.Objects[0]; ref.Inline != nil || ref.ID != "workbench" {
- t.Errorf("object 0 should be a reference to workbench, got %+v (inline=%v)", ref, ref.Inline)
+ if ref := room.Objects[0]; ref.Local != nil || ref.ID != "workbench" {
+ t.Errorf("object 0 should be a reference to workbench, got %+v (local=%v)", ref, ref.Local)
}
- // inline, id derived from the normalized name
+ // local, id derived from the normalized name
in := room.Objects[1]
- if in.Inline == nil {
- t.Fatalf("object 1 should be inline")
+ if in.Local == nil {
+ t.Fatalf("object 1 should be local")
}
if in.ID != "window" {
- t.Errorf("inline id should derive from name to %q, got %q", "window", in.ID)
+ t.Errorf("local id should derive from name to %q, got %q", "window", in.ID)
}
- if !in.Inline.Hidden || in.Inline.Name != "window" {
- t.Errorf("inline fields not parsed: %+v", in.Inline)
+ if !in.Local.Hidden || in.Local.Name != "window" {
+ t.Errorf("local fields not parsed: %+v", in.Local)
}
- // inline with a multi-word name: id is the normalized name (spaces kept),
+ // local with a multi-word name: id is the normalized name (spaces kept),
// and an explicit `id:` is NOT used as identity (it is preserved on the
// def only so validation can flag it).
ex := room.Objects[2]
- if ex.Inline == nil {
- t.Fatalf("object 2 should be inline")
+ if ex.Local == nil {
+ t.Fatalf("object 2 should be local")
}
if ex.ID != "instrument panel" {
- t.Errorf("inline id should be normalized name %q, got %q", "instrument panel", ex.ID)
+ t.Errorf("local id should be normalized name %q, got %q", "instrument panel", ex.ID)
}
- if ex.Inline.ID != "control" {
- t.Errorf("explicit id should be preserved on def for validation, got %q", ex.Inline.ID)
+ if ex.Local.ID != "control" {
+ t.Errorf("explicit id should be preserved on def for validation, got %q", ex.Local.ID)
}
- if len(ex.Inline.Aliases) != 1 || ex.Inline.Aliases[0] != "cockpit" {
- t.Errorf("inline aliases not parsed: %+v", ex.Inline.Aliases)
+ if len(ex.Local.Aliases) != 1 || ex.Local.Aliases[0] != "cockpit" {
+ t.Errorf("local aliases not parsed: %+v", ex.Local.Aliases)
}
}