Files
moby/internal/testutil/stringutils_test.go
Sebastiaan van Stijn 67e7274c95 internal/testutil: cleanup GenerateRandomAlphaOnlyString
- 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>
2026-06-18 13:05:17 +02:00

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))
}