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

Function Test_FormatMultipleFunctions

formatter_test.go:114–143  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

112}
113
114func Test_FormatMultipleFunctions(t *testing.T) {
115 contents := `package main
116
117// @Produce json
118// @Success 200 {object} string
119// @Failure 400 {object} string
120 func A() {}
121
122// @Description Description of B.
123// @Produce json
124// @Success 200 {array} string
125// @Failure 400 {object} string
126 func B() {}`
127
128 want := `package main
129
130// @Produce json
131// @Success 200 {object} string
132// @Failure 400 {object} string
133func A() {}
134
135// @Description Description of B.
136// @Produce json
137// @Success 200 {array} string
138// @Failure 400 {object} string
139func B() {}
140`
141
142 testFormat(t, "main.go", contents, want)
143}
144
145func Test_FormatApi(t *testing.T) {
146 contents := `package api

Callers

nothing calls this directly

Calls 1

testFormatFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…