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

Function TestString_Snake2Camel

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

Source from the content-addressed store, hash-verified

42}
43
44func TestString_Snake2Camel(t *testing.T) {
45 cases := []struct {
46 input string
47 want string
48 }{
49 {
50 input: "__",
51 want: "",
52 },
53 {
54 input: "go_zero",
55 want: "GoZero",
56 },
57 {
58 input: "の_go_zero",
59 want: "のGoZero",
60 },
61 {
62 input: "goZero",
63 want: "GoZero",
64 },
65 {
66 input: "goZero",
67 want: "GoZero",
68 },
69 {
70 input: "goZero_",
71 want: "GoZero",
72 },
73 {
74 input: "go_Zero_",
75 want: "GoZero",
76 },
77 {
78 input: "_go_Zero_",
79 want: "GoZero",
80 },
81 }
82 for _, c := range cases {
83 ret := From(c.input).ToCamel()
84 assert.Equal(t, c.want, ret)
85 }
86}
87
88func TestString_Camel2Snake(t *testing.T) {
89 cases := []struct {

Callers

nothing calls this directly

Calls 3

ToCamelMethod · 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…