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,41 @@
|
||||
package processing
|
||||
|
||||
import "testing"
|
||||
|
||||
func TestNormalizeProviderMode(t *testing.T) {
|
||||
t.Parallel()
|
||||
cases := []struct {
|
||||
in, want string
|
||||
}{
|
||||
{"", AIProviderUnknown},
|
||||
{"internal", AIProviderInternal},
|
||||
{"custom", AIProviderCustom},
|
||||
{"popular:openai", "popular:openai"},
|
||||
{"popular:", "popular:unknown"},
|
||||
{"weird", AIProviderUnknown},
|
||||
}
|
||||
for _, c := range cases {
|
||||
if got := normalizeProviderMode(c.in); got != c.want {
|
||||
t.Fatalf("normalize(%q)=%q want %q", c.in, got, c.want)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func TestCompleterProviderMode_OpenAIClient(t *testing.T) {
|
||||
t.Parallel()
|
||||
c := NewOpenAIClient("k", "", "m", 0, 1)
|
||||
if got := CompleterProviderMode(c); got != AIProviderInternal {
|
||||
t.Fatalf("got %q", got)
|
||||
}
|
||||
c.ModeLabel = "popular:groq"
|
||||
if got := CompleterProviderMode(c); got != "popular:groq" {
|
||||
t.Fatalf("got %q", got)
|
||||
}
|
||||
}
|
||||
|
||||
func TestCompleterProviderMode_Heuristic(t *testing.T) {
|
||||
t.Parallel()
|
||||
if got := CompleterProviderMode(HeuristicCompleter{}); got != AIProviderInternal {
|
||||
t.Fatalf("got %q", got)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user