MCPcopy
hub / github.com/duke-git/lancet / TestRandNumeralOrLetter

Function TestRandNumeralOrLetter

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

Source from the content-addressed store, hash-verified

65}
66
67func TestRandNumeralOrLetter(t *testing.T) {
68 t.Parallel()
69
70 pattern := `^[0-9a-zA-Z]+$`
71 reg := regexp.MustCompile(pattern)
72
73 randStr := RandNumeralOrLetter(10)
74
75 assert := internal.NewAssert(t, "TestRandNumeralOrLetter")
76 assert.Equal(10, len(randStr))
77 assert.Equal(true, reg.MatchString(randStr))
78}
79
80func TestRandInt(t *testing.T) {
81 t.Parallel()

Callers

nothing calls this directly

Calls 3

EqualMethod · 0.95
NewAssertFunction · 0.92
RandNumeralOrLetterFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…