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

Function TestRandNumeral

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

Source from the content-addressed store, hash-verified

52}
53
54func TestRandNumeral(t *testing.T) {
55 t.Parallel()
56
57 pattern := `^[0-9]+$`
58 reg := regexp.MustCompile(pattern)
59
60 randStr := RandNumeral(12)
61
62 assert := internal.NewAssert(t, "TestRandNumeral")
63 assert.Equal(12, len(randStr))
64 assert.Equal(true, reg.MatchString(randStr))
65}
66
67func TestRandNumeralOrLetter(t *testing.T) {
68 t.Parallel()

Callers

nothing calls this directly

Calls 3

EqualMethod · 0.95
NewAssertFunction · 0.92
RandNumeralFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…