aboutsummaryrefslogtreecommitdiff
path: root/internal/behavior/yml_test.go
diff options
context:
space:
mode:
authorhistoria <[not public]>2026-10-05 17:31:50 -0400
committerhistoria <[not public]>2026-10-05 17:31:50 -0400
commit516fd29da423432ef6dfded21a984f1d15dcab1a (patch)
treeeb2dabe325a1335dedac28a93453df643ef986f2 /internal/behavior/yml_test.go
parente42952469dadfb3535633c66c881050ac128703c (diff)
downloadthehouseoficarus-516fd29da423432ef6dfded21a984f1d15dcab1a.tar.gz
fix: slop casino and economy fixes
Diffstat (limited to 'internal/behavior/yml_test.go')
-rw-r--r--internal/behavior/yml_test.go29
1 files changed, 29 insertions, 0 deletions
diff --git a/internal/behavior/yml_test.go b/internal/behavior/yml_test.go
new file mode 100644
index 0000000..9452e9e
--- /dev/null
+++ b/internal/behavior/yml_test.go
@@ -0,0 +1,29 @@
+package behavior
+
+import (
+ "os"
+ "path/filepath"
+ "testing"
+)
+
+// Regression: WalkYAMLDir only matched .yaml, so a .yml trigger file loaded
+// and fired at runtime while every validation pass ignored it.
+func TestWalkYAMLDirIncludesYml(t *testing.T) {
+ dir := t.TempDir()
+ if err := os.WriteFile(filepath.Join(dir, "a.yaml"), []byte("x: 1"), 0644); err != nil {
+ t.Fatal(err)
+ }
+ if err := os.WriteFile(filepath.Join(dir, "b.yml"), []byte("x: 2"), 0644); err != nil {
+ t.Fatal(err)
+ }
+ ids := map[string]bool{}
+ if err := WalkYAMLDir(dir, func(path, id string, data []byte) error {
+ ids[id] = true
+ return nil
+ }); err != nil {
+ t.Fatal(err)
+ }
+ if !ids["a"] || !ids["b"] {
+ t.Fatalf("WalkYAMLDir ids = %v, want both a and b", ids)
+ }
+}