MCPcopy Create free account
hub / github.com/labstack/gommon / TestRandomString

Function TestRandomString

random/random_test.go:17–39  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

15}
16
17func TestRandomString(t *testing.T) {
18 var testCases = []struct {
19 name string
20 whenLength uint8
21 expect string
22 }{
23 {
24 name: "ok, 16",
25 whenLength: 16,
26 },
27 {
28 name: "ok, 32",
29 whenLength: 32,
30 },
31 }
32
33 for _, tc := range testCases {
34 t.Run(tc.name, func(t *testing.T) {
35 uid := String(tc.whenLength, Alphabetic)
36 assert.Len(t, uid, int(tc.whenLength))
37 })
38 }
39}
40
41func TestRandomStringBias(t *testing.T) {
42 t.Parallel()

Callers

nothing calls this directly

Calls 1

StringFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…