MCPcopy Create free account
hub / github.com/alibaba/open-code-review / TestNormalizeModelList

Function TestNormalizeModelList

cmd/opencodereview/config_cmd_test.go:1514–1537  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

1512}
1513
1514func TestNormalizeModelList(t *testing.T) {
1515 tests := []struct {
1516 name string
1517 models []string
1518 want []string
1519 }{
1520 {"dedup", []string{"a", "b", "a"}, []string{"a", "b"}},
1521 {"trim spaces", []string{" a ", " b "}, []string{"a", "b"}},
1522 {"filter empty", []string{"a", "", "b"}, []string{"a", "b"}},
1523 }
1524 for _, tc := range tests {
1525 t.Run(tc.name, func(t *testing.T) {
1526 got := normalizeModelList(tc.models)
1527 if len(got) != len(tc.want) {
1528 t.Fatalf("got %v, want %v", got, tc.want)
1529 }
1530 for i := range tc.want {
1531 if got[i] != tc.want[i] {
1532 t.Errorf("[%d] = %q, want %q", i, got[i], tc.want[i])
1533 }
1534 }
1535 })
1536 }
1537}
1538
1539func TestParseModelListValue(t *testing.T) {
1540 tests := []struct {

Callers

nothing calls this directly

Calls 2

normalizeModelListFunction · 0.85
RunMethod · 0.65

Tested by

no test coverage detected