From 2de0ff08359e481b1d6b8444a69a7920df144f85 Mon Sep 17 00:00:00 2001 From: Gary Sentosa Date: Sat, 12 Aug 2023 09:51:17 +0900 Subject: [PATCH] test: random string benchmark --- random/random_test.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/random/random_test.go b/random/random_test.go index 6009b89..e08d852 100644 --- a/random/random_test.go +++ b/random/random_test.go @@ -12,3 +12,9 @@ func Test(t *testing.T) { r := New() assert.Regexp(t, regexp.MustCompile("[0-9]+$"), r.String(8, Numeric)) } + +func BenchmarkRandomString(b *testing.B) { + for n := 0; n < b.N; n++ { + String(32, Alphanumeric) + } +}