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

Function TestStringCharset

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

Source from the content-addressed store, hash-verified

24}
25
26func TestStringCharset(t *testing.T) {
27 t.Parallel()
28
29 tests := []struct {
30 Name string
31 Charset string
32 HelperFunc func(int) (string, error)
33 Length int
34 }{
35 {
36 Name: "MultiByte-20",
37 Charset: "💓😘💓🌷",
38 Length: 20,
39 },
40 {
41 Name: "MultiByte-7",
42 Charset: "😇🥰😍🤩😘😗☺️😚😙🥲😋😛😜🤪😝🤑",
43 Length: 7,
44 },
45 {
46 Name: "MixedBytes",
47 Charset: "🍋🍌🍍🥭🍎🍏🍐🍑🍒🍓🫐🥝🍅🫒🥥🥑🍆🥔abcdefg1234",
48 Length: 10,
49 },
50 {
51 Name: "Empty",
52 Charset: cryptorand.Default,
53 Length: 0,
54 HelperFunc: cryptorand.String,
55 },
56 {
57 Name: "Numeric",
58 Charset: cryptorand.Numeric,
59 Length: 1,
60 },
61 {
62 Name: "Upper",
63 Charset: cryptorand.Upper,
64 Length: 3,
65 },
66 {
67 Name: "Lower",
68 Charset: cryptorand.Lower,
69 Length: 10,
70 },
71 {
72 Name: "Alpha",
73 Charset: cryptorand.Alpha,
74 Length: 20,
75 },
76 {
77 Name: "Default",
78 Charset: cryptorand.Default,
79 Length: 10,
80 },
81 {
82 Name: "Hex",
83 Charset: cryptorand.Hex,

Callers

nothing calls this directly

Calls 4

StringCharsetFunction · 0.92
RunMethod · 0.65
LogfMethod · 0.65
EqualMethod · 0.45

Tested by

no test coverage detected