feat(rands): initial implementation

This commit is contained in:
2021-01-20 02:57:34 +00:00
parent 3ddcfd415c
commit 597fe535d3
18 changed files with 1603 additions and 1 deletions

27
bytes_test.go Normal file
View File

@@ -0,0 +1,27 @@
package rands
import (
"testing"
"github.com/stretchr/testify/assert"
)
func TestBytes(t *testing.T) {
for _, tt := range testCases {
t.Run(tt.name, func(t *testing.T) {
got, _ := Bytes(tt.n)
assert.Len(t, got, tt.n)
})
}
}
func BenchmarkBytes(b *testing.B) {
for _, tt := range testCases {
b.Run(tt.name, func(b *testing.B) {
for n := 0; n < b.N; n++ {
_, _ = Bytes(tt.n)
}
})
}
}