summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorEuAndreh <eu@euandre.org>2024-09-22 21:41:51 -0300
committerEuAndreh <eu@euandre.org>2024-09-22 21:48:09 -0300
commit4693a9fd486694dedda1c241097829b8b2f040a4 (patch)
treedf12f742f23eaeb0f7c677b94c98263ed25c9581 /tests
parentsrc/guuid.go: Export UUIDByteCount (diff)
downloaduuid-4693a9fd486694dedda1c241097829b8b2f040a4.tar.gz
uuid-4693a9fd486694dedda1c241097829b8b2f040a4.tar.xz
src/guuid.go: Add NewBytes() function
Diffstat (limited to 'tests')
-rw-r--r--tests/guuid.go15
1 files changed, 15 insertions, 0 deletions
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()
}