MCPcopy Index your code
hub / github.com/oapi-codegen/oapi-codegen / TestToCamelCaseWithInitialisms

Function TestToCamelCaseWithInitialisms

pkg/codegen/utils_test.go:101–157  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

99}
100
101func TestToCamelCaseWithInitialisms(t *testing.T) {
102 tests := []struct {
103 str string
104 want string
105 }{{
106 str: "",
107 want: "",
108 }, {
109 str: "hello",
110 want: "Hello",
111 }, {
112 str: "DBError",
113 want: "DBError",
114 }, {
115 str: "httpOperationId",
116 want: "HTTPOperationID",
117 }, {
118 str: "OperationId",
119 want: "OperationID",
120 }, {
121 str: "peer2peer",
122 want: "Peer2Peer",
123 }, {
124 str: "makeUtf8",
125 want: "MakeUTF8",
126 }, {
127 str: "utf8Hello",
128 want: "UTF8Hello",
129 }, {
130 str: "myDBError",
131 want: "MyDBError",
132 }, {
133 str: " DbLayer ",
134 want: "DBLayer",
135 }, {
136 str: "FindPetById",
137 want: "FindPetByID",
138 }, {
139 str: "MyHttpUrl",
140 want: "MyHTTPURL",
141 }, {
142 str: "find_user_by_uuid",
143 want: "FindUserByUUID",
144 }, {
145 str: "HelloПриветWorldМир42",
146 want: "HelloПриветWorldМир42",
147 }, {
148 str: "пир2пир",
149 want: "Пир2Пир",
150 }}
151 for i := range tests {
152 tt := tests[i]
153 t.Run(tt.str, func(t *testing.T) {
154 require.Equal(t, tt.want, ToCamelCaseWithInitialisms(tt.str))
155 })
156 }
157}
158

Callers

nothing calls this directly

Calls 2

RunMethod · 0.80

Tested by

no test coverage detected