MCPcopy Index your code
hub / github.com/coder/coder / TestSha1String

Function TestSha1String

cryptorand/strings_test.go:125–134  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

123}
124
125func TestSha1String(t *testing.T) {
126 t.Parallel()
127
128 for i := 0; i < 20; i++ {
129 rs, err := cryptorand.Sha1String()
130 require.NoError(t, err, "unexpected error from String")
131 require.Equal(t, 40, utf8.RuneCountInString(rs), "expected RuneCountInString to match requested")
132 t.Logf("value: %v <- random?", rs)
133 }
134}
135
136func BenchmarkString20(b *testing.B) {
137 b.SetBytes(20)

Callers

nothing calls this directly

Calls 3

Sha1StringFunction · 0.92
LogfMethod · 0.65
EqualMethod · 0.45

Tested by

no test coverage detected