diff options
| author | historia <[not public]> | 2026-10-05 17:31:50 -0400 |
|---|---|---|
| committer | historia <[not public]> | 2026-10-05 17:31:50 -0400 |
| commit | 516fd29da423432ef6dfded21a984f1d15dcab1a (patch) | |
| tree | eb2dabe325a1335dedac28a93453df643ef986f2 /internal/behavior/yml_test.go | |
| parent | e42952469dadfb3535633c66c881050ac128703c (diff) | |
| download | thehouseoficarus-516fd29da423432ef6dfded21a984f1d15dcab1a.tar.gz | |
fix: slop casino and economy fixes
Diffstat (limited to 'internal/behavior/yml_test.go')
| -rw-r--r-- | internal/behavior/yml_test.go | 29 |
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) + } +} |
