ids-svc-product/internal/repository/product_batch_test.go
robinj0726 947a1dea7c feat: add catalog category list filter and batch product writes
Support AND category/group filtering and store-scoped batch status, delete, absolute price, and replace-group with a 100-item cap.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-10-01 23:47:53 +08:00

21 lines
622 B
Go

package repository
import "testing"
func TestParseBatchProductIDs(t *testing.T) {
parsed, unique, err := parseBatchProductIDs([]string{" 11111 ", "11111", "22222"})
if err != nil {
t.Fatalf("parseBatchProductIDs() error = %v", err)
}
if len(unique) != 2 || unique[0] != "11111" || unique[1] != "22222" {
t.Fatalf("unique = %v, want [11111 22222]", unique)
}
if len(parsed) != 2 || parsed[0] != 11111 || parsed[1] != 22222 {
t.Fatalf("parsed = %v, want [11111 22222]", parsed)
}
if _, _, err := parseBatchProductIDs(nil); err == nil {
t.Fatal("parseBatchProductIDs(nil) error = nil, want required")
}
}