update
This commit is contained in:
28
internal/pkg/season/season_test.go
Normal file
28
internal/pkg/season/season_test.go
Normal 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)
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user