MCPcopy Create free account
hub / github.com/google/gapid / TestSplitPascalCase

Function TestSplitPascalCase

gapil/template/strings_test.go:77–105  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

75}
76
77func TestSplitPascalCase(t *testing.T) {
78 for _, v := range []struct {
79 in string
80 expected stringList
81 }{
82 {
83 "abcDEFgh",
84 stringList{"abc", "D", "E", "Fgh"},
85 }, {
86 "ABC_DEF",
87 stringList{"A", "B", "C_D", "E", "F"},
88 }, {
89 "ATitledString",
90 stringList{"A", "Titled", "String"},
91 }, {
92 "anUntitledString",
93 stringList{"an", "Untitled", "String"},
94 }, {
95 "xxx123ABC456DEf789ghi",
96 stringList{"xxx123A", "B", "C456D", "Ef789ghi"},
97 },
98 } {
99 got := Functions{}.SplitPascalCase(v.in)
100 if !reflect.DeepEqual(v.expected, got) {
101 t.Errorf("SplitPascalCase(%#v) returned unexpected value. Expected: %#v, got: %#v",
102 v.in, v.expected, got)
103 }
104 }
105}
106
107func TestTitle(t *testing.T) {
108 in := stringList{"abc", "dE f", "G hi", "JKL"}

Callers

nothing calls this directly

Calls 2

SplitPascalCaseMethod · 0.80
DeepEqualMethod · 0.80

Tested by

no test coverage detected