mirror of
https://github.com/moby/moby.git
synced 2026-08-12 22:16:46 +00:00
- use math/rand/v2 - change the util to only produce lowercase; some tests only could use lowercase, and we don't need uppercase here, as long as it's random. - drop the Uniqueness test; it was effectively just testing stdlib functionality (math/rand/v2 to be random). - rename to RandomAlpha while we had to update call-sites Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
15 lines
257 B
Go
15 lines
257 B
Go
package testutil
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"gotest.tools/v3/assert"
|
|
is "gotest.tools/v3/assert/cmp"
|
|
)
|
|
|
|
func TestRandomAlphaOnlyString(t *testing.T) {
|
|
expectedLength := 20
|
|
s := RandomAlpha(expectedLength)
|
|
assert.Check(t, is.Equal(len(s), expectedLength))
|
|
}
|