From 516fd29da423432ef6dfded21a984f1d15dcab1a Mon Sep 17 00:00:00 2001 From: historia <[not public]> Date: Mon, 5 Oct 2026 17:31:50 -0400 Subject: fix: slop casino and economy fixes --- internal/behavior/yml_test.go | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 internal/behavior/yml_test.go (limited to 'internal/behavior/yml_test.go') 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) + } +} -- cgit v1.2.3