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

Function TestWriteUpperFirstLowerRest

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

Source from the content-addressed store, hash-verified

33)
34
35func TestWriteUpperFirstLowerRest(t *testing.T) {
36 tests := []struct {
37 in string
38 cur string
39 out string
40 }{
41 {"", "", ""},
42 {"a", "", "A"},
43 {"A", "", "A"},
44 {"abc", "", "Abc"},
45 {"Abc", "", "Abc"},
46 {"aBc", "", "Abc"},
47 {"aBC", "", "Abc"},
48 {"aBCD", "", "Abcd"},
49 {"", "z", "z"},
50 {"a", "z", "zA"},
51 {"A", "z", "zA"},
52 {"abc", "z", "zAbc"},
53 {"Abc", "z", "zAbc"},
54 {"aBc", "z", "zAbc"},
55 {"aBC", "z", "zAbc"},
56 {"aBCD", "z", "zAbcd"},
57 }
58 for _, test := range tests {
59 t.Run(test.in, func(t *testing.T) {
60 var b strings.Builder
61 b.WriteString(test.cur)
62 token.WriteUpperFirstLowerRest(&b, token.DefaultCaser, test.in)
63 if b.String() != test.out {
64 t.Errorf("expected %s, got %s", test.out, b.String())
65 }
66 })
67 }
68}
69
70func TestWriteSplitLowerFirstUpperRest(t *testing.T) {
71 tests := []struct {

Callers

nothing calls this directly

Calls 2

WriteUpperFirstLowerRestFunction · 0.92
StringMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…