aboutsummaryrefslogtreecommitdiff
path: root/internal/strutil/strutil_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/strutil/strutil_test.go')
-rw-r--r--internal/strutil/strutil_test.go14
1 files changed, 14 insertions, 0 deletions
diff --git a/internal/strutil/strutil_test.go b/internal/strutil/strutil_test.go
index d603533b..c4edf140 100644
--- a/internal/strutil/strutil_test.go
+++ b/internal/strutil/strutil_test.go
@@ -41,3 +41,17 @@ func TestToUpperFirst(t *testing.T) {
})
}
}
+
+func TestRandomChars(t *testing.T) {
+ cache := make(map[string]bool)
+ for i := 0; i < 100; i++ {
+ chars, err := RandomChars(10)
+ if err != nil {
+ t.Fatal(err)
+ }
+ if cache[chars] {
+ t.Fatalf("Duplicated chars %q", chars)
+ }
+ cache[chars] = true
+ }
+}