MCPcopy Create free account
hub / github.com/bytebase/bytebase / TestToSnakeCase

Function TestToSnakeCase

backend/api/v1/acl_test.go:156–183  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

154}
155
156func TestToSnakeCase(t *testing.T) {
157 tests := []struct {
158 input string
159 want string
160 }{
161 {
162 input: "DatabaseGroup",
163 want: "database_group",
164 },
165 {
166 input: "User",
167 want: "user",
168 },
169 {
170 input: "Instance",
171 want: "instance",
172 },
173 {
174 input: "IdentityProvider",
175 want: "identity_provider",
176 },
177 }
178
179 for _, tt := range tests {
180 got := toSnakeCase(tt.input)
181 require.Equal(t, tt.want, got, tt.input)
182 }
183}
184
185func TestHasAllowMissingEnabled(t *testing.T) {
186 tests := []struct {

Callers

nothing calls this directly

Calls 2

toSnakeCaseFunction · 0.85
EqualMethod · 0.65

Tested by

no test coverage detected