We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c279a53 commit 0185e55Copy full SHA for 0185e55
staging/src/k8s.io/apimachinery/pkg/util/rand/rand_test.go
@@ -24,6 +24,7 @@ import (
24
25
const (
26
maxRangeTestCount = 500
27
+ testStringLength = 32
28
)
29
30
func TestString(t *testing.T) {
@@ -99,3 +100,15 @@ func TestInt63nRange(t *testing.T) {
99
100
}
101
102
103
+
104
+func BenchmarkRandomStringGeneration(b *testing.B) {
105
+ b.ResetTimer()
106
+ var s string
107
+ for i := 0; i < b.N; i++ {
108
+ s = String(testStringLength)
109
+ }
110
+ b.StopTimer()
111
+ if len(s) == 0 {
112
+ b.Fatal(s)
113
114
+}
0 commit comments