From 4693a9fd486694dedda1c241097829b8b2f040a4 Mon Sep 17 00:00:00 2001 From: EuAndreh Date: Sun, 22 Sep 2024 21:41:51 -0300 Subject: src/guuid.go: Add NewBytes() function --- tests/guuid.go | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'tests/guuid.go') diff --git a/tests/guuid.go b/tests/guuid.go index 6470fca..ca20b49 100644 --- a/tests/guuid.go +++ b/tests/guuid.go @@ -167,6 +167,20 @@ func test_New() { }) } +func test_NewBytes() { + testStart("NewBytes()") + + testing("the slice has the same length of the original array", func() { + array := New() + slice := NewBytes() + assertEq(len(slice), len(array)) + }) + + testing("we get the correct byte count", func() { + assertEq(len(NewBytes()), UUIDByteCount) + }) +} + func test_String() { testStart("UUID.String()") @@ -242,6 +256,7 @@ func test_FromString() { func MainTest() { test_NewFrom() test_New() + test_NewBytes() test_String() test_FromString() } -- cgit v1.2.3