From b6b81ac135e77f7856efb07389a6ac42cc137a6e Mon Sep 17 00:00:00 2001 From: Sam Anthony Date: Tue, 5 May 2026 18:10:38 -0400 Subject: pod_package_id --- pod_test.go | 67 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 pod_test.go (limited to 'pod_test.go') diff --git a/pod_test.go b/pod_test.go new file mode 100644 index 0000000..c54b8e5 --- /dev/null +++ b/pod_test.go @@ -0,0 +1,67 @@ +package lulu_test + +import ( + "encoding/json" + "testing" + + "github.com/stretchr/testify/require" + + "git.samanthony.xyz/lulu" +) + +func TestPod(t *testing.T) { + t.Parallel() + requireJsonEq(t, + "0850X1100.BW.STD.LW.060UW444.MNG", + lulu.PodPkgId{ + lulu.UsLetter, + lulu.Mono, + lulu.Standard, + lulu.LinenWrap, + lulu.P60UncoatedWhite, + lulu.Matte, + lulu.NavyLinen, + lulu.GoldFoil}) + requireJsonEq(t, + "0600X0900.FC.STD.PB.080CW444.GXX", + lulu.PodPkgId{ + lulu.UsTrade, + lulu.Color, + lulu.Standard, + lulu.Perfect, + lulu.P80CoatedWhite, + lulu.Gloss, + lulu.NoLinen, + lulu.NoFoil}) + requireJsonEq(t, + "0700X1000.FC.PRE.CO.060UC444.MXX", + lulu.PodPkgId{ + lulu.Executive, + lulu.Color, + lulu.Premium, + lulu.Coil, + lulu.P60UncoatedCream, + lulu.Matte, + lulu.NoLinen, + lulu.NoFoil}) + requireJsonEq(t, + "0600X0900.BW.STD.PB.060UW444.MXX", + lulu.PodPkgId{ + lulu.UsTrade, + lulu.Mono, + lulu.Standard, + lulu.Perfect, + lulu.P60UncoatedWhite, + lulu.Matte, + lulu.NoLinen, + lulu.NoFoil}) +} + +func requireJsonEq(t *testing.T, expected string, actual json.Marshaler) { + t.Helper() + a, err := json.Marshal(expected) + require.NoError(t, err) + b, err := json.Marshal(actual) + require.NoError(t, err) + require.JSONEq(t, string(a), string(b)) +} -- cgit v1.2.3