aboutsummaryrefslogtreecommitdiff
path: root/internal/player/xp_test.go
diff options
context:
space:
mode:
authorhistoria <[not public]>2026-10-05 17:05:14 -0400
committerhistoria <[not public]>2026-10-05 17:05:14 -0400
commite42952469dadfb3535633c66c881050ac128703c (patch)
treea78f7396b72cdbd6fa4f6c454c830f40cf2ad0cb /internal/player/xp_test.go
parent90ad8c0c33b519d5830c69d4128bdc984b5e9de8 (diff)
downloadthehouseoficarus-e42952469dadfb3535633c66c881050ac128703c.tar.gz
fix: gather verbs, walk oom, admin path bypass, roulette refund
Diffstat (limited to 'internal/player/xp_test.go')
-rw-r--r--internal/player/xp_test.go15
1 files changed, 15 insertions, 0 deletions
diff --git a/internal/player/xp_test.go b/internal/player/xp_test.go
new file mode 100644
index 0000000..fc0eeb4
--- /dev/null
+++ b/internal/player/xp_test.go
@@ -0,0 +1,15 @@
+package player
+
+import "testing"
+
+// Regression: XPTable was declared [100]int with 99 initializers, so index 99
+// silently read as 0 ("level 100 costs 0 XP"). The array is now sized so an
+// out-of-range index is a compile error.
+func TestXPTableBounds(t *testing.T) {
+ if len(XPTable) != 99 {
+ t.Fatalf("len(XPTable) = %d, want 99", len(XPTable))
+ }
+ if XPTable[98] != 13034431 {
+ t.Fatalf("XPTable[98] = %d, want 13034431", XPTable[98])
+ }
+}