Files
backend_v2/internal/pkg/season/season_test.go
toom1996 10d8a96e8c update
2026-09-07 00:04:01 +08:00

29 lines
707 B
Go

package season
import "testing"
func TestDerive(t *testing.T) {
cases := []struct {
year uint16
col string
season string
want string
}{
{2026, ColRTW, SeasonSpring, "SS26"},
{2025, "", SeasonFall, "FW25"},
{2026, ColResort, "", "RES26"},
{2026, ColPreFall, "", "PF26"},
{2025, ColMenswear, "", "FW25"},
{2025, ColCouture, "", "FW25"},
{2026, "", "", "SS26"}, // 二者皆空回落 SS
{0, ColRTW, SeasonSpring, ""}, // 未知年份无法编码
{2099, ColRTW, SeasonSpring, "SS99"},
}
for _, c := range cases {
got := Derive(c.year, c.col, c.season)
if got != c.want {
t.Fatalf("Derive(%d,%q,%q)=%q want %q", c.year, c.col, c.season, got, c.want)
}
}
}