MCPcopy Index your code
hub / github.com/labstack/echo / TestRandomString

Function TestRandomString

middleware/util_test.go:53–75  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

51}
52
53func TestRandomString(t *testing.T) {
54 var testCases = []struct {
55 name string
56 whenLength uint8
57 expect string
58 }{
59 {
60 name: "ok, 16",
61 whenLength: 16,
62 },
63 {
64 name: "ok, 32",
65 whenLength: 32,
66 },
67 }
68
69 for _, tc := range testCases {
70 t.Run(tc.name, func(t *testing.T) {
71 uid := randomString(tc.whenLength)
72 assert.Len(t, uid, int(tc.whenLength))
73 })
74 }
75}
76
77func TestRandomStringBias(t *testing.T) {
78 t.Parallel()

Callers

nothing calls this directly

Calls 1

randomStringFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…