package storage import "testing" func TestIsPublicAssetKey(t *testing.T) { cases := []struct { key string want bool }{ {"publish-attachments/t1/a1/x.png", true}, {"ephemeral/abc123", true}, {"avatars/default/u.png", true}, {"secrets/token.txt", false}, {"publish-attachments/../etc/passwd", false}, {"", false}, } for _, tc := range cases { if got := IsPublicAssetKey(tc.key); got != tc.want { t.Fatalf("IsPublicAssetKey(%q) = %v, want %v", tc.key, got, tc.want) } } }