MCPcopy
hub / github.com/pocketbase/pocketbase / TestCamelize

Function TestCamelize

tools/inflector/inflector_test.go:147–175  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

145}
146
147func TestCamelize(t *testing.T) {
148 scenarios := []struct {
149 val string
150 expected string
151 }{
152 {"", ""},
153 {" ", ""},
154 {"Test", "Test"},
155 {"test", "Test"},
156 {"testTest2", "TestTest2"},
157 {"TestTest2", "TestTest2"},
158 {"test test2", "TestTest2"},
159 {"test-test2", "TestTest2"},
160 {"test'test2", "TestTest2"},
161 {"test1test2", "Test1test2"},
162 {"1test-test2", "1testTest2"},
163 {"123", "123"},
164 {"123a", "123a"},
165 }
166
167 for i, s := range scenarios {
168 t.Run(fmt.Sprintf("%d_%#v", i, s.val), func(t *testing.T) {
169 result := inflector.Camelize(s.val)
170 if result != s.expected {
171 t.Fatalf("Expected %q, got %q", s.expected, result)
172 }
173 })
174 }
175}

Callers

nothing calls this directly

Calls 2

CamelizeFunction · 0.92
RunMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…