Skip to content

Commit

Permalink
add uuid, timeuuid values test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
illia-li committed Jan 24, 2025
1 parent 646318e commit 0fec673
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions tests/serialization/marshal_13_uuids_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
})
}
}
Expand Down Expand Up @@ -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)
})
}
}

0 comments on commit 0fec673

Please sign in to comment.