MCPcopy
hub / github.com/swaggo/swag / TestParseRouterCommentWithColonSign

Function TestParseRouterCommentWithColonSign

operation_test.go:199–209  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

197}
198
199func TestParseRouterCommentWithColonSign(t *testing.T) {
200 t.Parallel()
201
202 comment := `/@Router /customer/get-wishlist/{wishlist_id}:move [post]`
203 operation := NewOperation(nil)
204 err := operation.ParseComment(comment, nil)
205 assert.NoError(t, err)
206 assert.Len(t, operation.RouterProperties, 1)
207 assert.Equal(t, "/customer/get-wishlist/{wishlist_id}:move", operation.RouterProperties[0].Path)
208 assert.Equal(t, "POST", operation.RouterProperties[0].HTTPMethod)
209}
210
211func TestParseRouterCommentNoColonSignAtPathStartErr(t *testing.T) {
212 t.Parallel()

Callers

nothing calls this directly

Calls 2

ParseCommentMethod · 0.95
NewOperationFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…