diff options
Diffstat (limited to '')
-rw-r--r-- | tests/functional/string-round-trip/uuid.go | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/tests/functional/string-round-trip/uuid.go b/tests/functional/string-round-trip/uuid.go index 000d3fb..82414ea 100644 --- a/tests/functional/string-round-trip/uuid.go +++ b/tests/functional/string-round-trip/uuid.go @@ -45,16 +45,31 @@ func assertEq(given any, expected any) { func MainTest() { - testing("string is the same after round-trip", func() { - str1 := New().String() + testing("v4 string is the same after round-trip", func() { + str1 := NewV4().String() id, err := FromString(str1) assertEq(err, nil) str2 := id.String() assertEq(str1, str2) }) - testing("UUID is the same after round-trip", func() { - id1 := New() + testing("v4 UUID is the same after round-trip", func() { + id1 := NewV4() + id2, err := FromString(id1.String()) + assertEq(err, nil) + assertEq(id1, id2) + }) + + testing("v7 string is the same after round-trip", func() { + str1 := NewV7().String() + id, err := FromString(str1) + assertEq(err, nil) + str2 := id.String() + assertEq(str1, str2) + }) + + testing("v7 UUID is the same after round-trip", func() { + id1 := NewV7() id2, err := FromString(id1.String()) assertEq(err, nil) assertEq(id1, id2) |