package web import "testing" func TestTheExampleNamesARealModel(t *testing.T) { // Every other field in that curl is filled in — the base URL, the key — // so the one placeholder in it reads like a value. It was copied verbatim // and sent as the literal string MODEL. p := &AccountPages{} if got := p.exampleModel(); got != "" { t.Errorf("with no source the example should be an obvious placeholder, got %q", got) } p.ServedModels(func() []string { return nil }) if got := p.exampleModel(); got != "" { t.Errorf("with nothing served the example should be a placeholder, got %q", got) } p.ServedModels(func() []string { return []string{"qwen", "big-model"} }) if got := p.exampleModel(); got != "qwen" { t.Errorf("example model = %q, want the first served name", got) } }