MCPcopy Create free account
hub / github.com/gogs/gogs / TestRandomChars

Function TestRandomChars

internal/strutil/strutil_test.go:41–53  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

39}
40
41func TestRandomChars(t *testing.T) {
42 cache := make(map[string]bool)
43 for i := 0; i < 100; i++ {
44 chars, err := RandomChars(10)
45 if err != nil {
46 t.Fatal(err)
47 }
48 if cache[chars] {
49 t.Fatalf("Duplicated chars %q", chars)
50 }
51 cache[chars] = true
52 }
53}
54
55func TestEllipsis(t *testing.T) {
56 tests := []struct {

Callers

nothing calls this directly

Calls 1

RandomCharsFunction · 0.85

Tested by

no test coverage detected