(t *testing.T)
| 1512 | } |
| 1513 | |
| 1514 | func 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 | |
| 1539 | func TestParseModelListValue(t *testing.T) { |
| 1540 | tests := []struct { |
nothing calls this directly
no test coverage detected