MCPcopy Create free account
hub / github.com/chanced/caps / TestWriteSplitLowerFirstUpperRest

Function TestWriteSplitLowerFirstUpperRest

token/token_test.go:70–103  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

68}
69
70func TestWriteSplitLowerFirstUpperRest(t *testing.T) {
71 tests := []struct {
72 in string
73 cur string
74 out string
75 }{
76 {"", "", ""},
77 {"a", "", "a"},
78 {"aa", "", "a-A"},
79 {"aBC", "", "a-B-C"},
80 {"aBC", "", "a-B-C"},
81 {"aBc", "", "a-B-C"},
82 {"aBC", "", "a-B-C"},
83 {"aBCD", "", "a-B-C-D"},
84 {"", "z", "z"},
85 {"a", "z", "z-a"},
86 {"aa", "z", "z-a-A"},
87 {"aBC", "z", "z-a-B-C"},
88 {"aBC", "z", "z-a-B-C"},
89 {"aBc", "z", "z-a-B-C"},
90 {"aBC", "z", "z-a-B-C"},
91 {"aBCD", "z", "z-a-B-C-D"},
92 }
93 for _, test := range tests {
94 t.Run(test.in, func(t *testing.T) {
95 var b strings.Builder
96 b.WriteString(test.cur)
97 token.WriteSplitLowerFirstUpperRest(&b, token.DefaultCaser, "-", test.in)
98 if b.String() != test.out {
99 t.Errorf("expected %s, got %s", test.out, b.String())
100 }
101 })
102 }
103}
104
105func TestWriteSplitLower(t *testing.T) {
106 tests := []struct {

Callers

nothing calls this directly

Calls 2

StringMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…