This commit is contained in:
toom1996
2026-09-07 00:04:01 +08:00
parent 6a5a4378ab
commit 10d8a96e8c
29 changed files with 5349 additions and 0 deletions

View File

@ -0,0 +1,28 @@
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)
}
}
}