MCPcopy Index your code
hub / github.com/zeromicro/go-zero / TestString_Camel2Snake

Function TestString_Camel2Snake

tools/goctl/util/stringx/string_test.go:88–114  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

86}
87
88func TestString_Camel2Snake(t *testing.T) {
89 cases := []struct {
90 input string
91 want string
92 }{
93 {
94 input: "goZero",
95 want: "go_zero",
96 },
97 {
98 input: "Gozero",
99 want: "gozero",
100 },
101 {
102 input: "GoZero",
103 want: "go_zero",
104 },
105 {
106 input: "Go_Zero",
107 want: "go__zero",
108 },
109 }
110 for _, c := range cases {
111 ret := From(c.input).ToSnake()
112 assert.Equal(t, c.want, ret)
113 }
114}
115
116func TestTitle(t *testing.T) {
117 cases := []struct {

Callers

nothing calls this directly

Calls 3

ToSnakeMethod · 0.80
FromFunction · 0.70
EqualMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…