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

Function TestRandBytes

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

Source from the content-addressed store, hash-verified

95}
96
97func TestRandBytes(t *testing.T) {
98 t.Parallel()
99
100 assert := internal.NewAssert(t, "TestRandBytes")
101
102 randBytes := RandBytes(4)
103 assert.Equal(4, len(randBytes))
104
105 v := reflect.ValueOf(randBytes)
106 elemType := v.Type().Elem()
107 assert.Equal(reflect.Slice, v.Kind())
108 assert.Equal(reflect.Uint8, elemType.Kind())
109
110 assert.Equal([]byte{}, RandBytes(0))
111}
112
113func TestUUIdV4(t *testing.T) {
114 t.Parallel()

Callers

nothing calls this directly

Calls 5

EqualMethod · 0.95
NewAssertFunction · 0.92
RandBytesFunction · 0.85
KindMethod · 0.80
ValueOfMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…