Files
affiliate_dash/backend/internal/service/merchant_helpers_test.go
T
yml2213andCursor df1a170d44 refactor(catalog): 废弃 LEWAN_ 镜像,统一英文 SKU 与积分价,商品图按 SKU 缓存
对外目录只保留英文主 sku;迁移硬删镜像并校准 1元=100积分;发货页/凭证优先使用 local {sku}.webp。

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-14 20:00:26 +08:00

24 lines
488 B
Go

package service
import "testing"
func TestIsLegacyLewanMirrorSKU(t *testing.T) {
cases := []struct {
sku string
want bool
}{
{"LEWAN_8EED3610", true},
{"lewan_abc", true},
{"Lewan_x", true},
{"suit_shadow_gothic", false},
{"pack_dragon_palace", false},
{"", false},
{" LEWAN_X ", true},
}
for _, tc := range cases {
if got := IsLegacyLewanMirrorSKU(tc.sku); got != tc.want {
t.Fatalf("IsLegacyLewanMirrorSKU(%q)=%v want %v", tc.sku, got, tc.want)
}
}
}