Initial commit of Descrybe v2 without local scratch artifacts.
Drop one-shot tmp/axe scripts and agent i18n scratch so the Gitea tree is deployable.
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
package aiprovider
|
||||
|
||||
import "testing"
|
||||
|
||||
func TestAnalyticsClass(t *testing.T) {
|
||||
t.Parallel()
|
||||
cases := []struct {
|
||||
in, want string
|
||||
}{
|
||||
{"", "unknown"},
|
||||
{"unknown", "unknown"},
|
||||
{"internal", "internal"},
|
||||
{"custom", "custom"},
|
||||
{"popular:openai", "popular"},
|
||||
{"popular:groq", "popular"},
|
||||
{"POPULAR:openai", "popular"},
|
||||
{"weird", "unknown"},
|
||||
}
|
||||
for _, c := range cases {
|
||||
if got := AnalyticsClass(c.in); got != c.want {
|
||||
t.Fatalf("AnalyticsClass(%q)=%q want %q", c.in, got, c.want)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func TestNormalizeAnalyticsMode(t *testing.T) {
|
||||
t.Parallel()
|
||||
if got := NormalizeAnalyticsMode("popular:"); got != "popular:unknown" {
|
||||
t.Fatalf("got %q", got)
|
||||
}
|
||||
if got := NormalizeAnalyticsMode("CUSTOM"); got != "custom" {
|
||||
t.Fatalf("got %q", got)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user