From 83214b6642665819da840ad7015a9968690793bb Mon Sep 17 00:00:00 2001 From: illia-li Date: Mon, 20 Jan 2025 13:03:07 -0400 Subject: [PATCH] add `uuid`, `timeuuid` values test cases --- tests/serialization/marshal_13_uuids_test.go | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/tests/serialization/marshal_13_uuids_test.go b/tests/serialization/marshal_13_uuids_test.go index df6b2c15c..16bce6200 100644 --- a/tests/serialization/marshal_13_uuids_test.go +++ b/tests/serialization/marshal_13_uuids_test.go @@ -104,6 +104,16 @@ func TestMarshalUUIDs(t *testing.T) { gocql.UUID{233, 57, 245, 42, 214, 144, 17, 239, 156, 210, 2, 66, 172, 18, 0, 2}, }.AddVariants(mod.All...), }.Run("uuid", t, marshal, unmarshal) + + serialization.PositiveSet{ + Data: []byte("\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff"), + Values: mod.Values{ + "ffffffff-ffff-ffff-ffff-ffffffffffff", + []byte{255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255}, + [16]byte{255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255}, + gocql.UUID{255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255}, + }.AddVariants(mod.All...), + }.Run("max", t, marshal, unmarshal) }) } } @@ -142,6 +152,16 @@ func TestMarshalTimeUUID(t *testing.T) { "00000000-0000-0000-0000-000000000000", }.AddVariants(mod.All...), }.Run("zero", t, marshal, unmarshal) + + serialization.PositiveSet{ + Data: []byte("\xff\xff\xff\xff\xff\xff\x1f\xff\xff\xff\xff\xff\xff\xff\xff\xff"), + Values: mod.Values{ + "ffffffff-ffff-1fff-ffff-ffffffffffff", + []byte{255, 255, 255, 255, 255, 255, 31, 255, 255, 255, 255, 255, 255, 255, 255, 255}, + [16]byte{255, 255, 255, 255, 255, 255, 31, 255, 255, 255, 255, 255, 255, 255, 255, 255}, + gocql.UUID{255, 255, 255, 255, 255, 255, 31, 255, 255, 255, 255, 255, 255, 255, 255, 255}, + }.AddVariants(mod.All...), + }.Run("max", t, marshal, unmarshal) }) } }