(t *testing.T)
| 112 | } |
| 113 | |
| 114 | func 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 |
| 133 | func A() {} |
| 134 | |
| 135 | // @Description Description of B. |
| 136 | // @Produce json |
| 137 | // @Success 200 {array} string |
| 138 | // @Failure 400 {object} string |
| 139 | func B() {} |
| 140 | ` |
| 141 | |
| 142 | testFormat(t, "main.go", contents, want) |
| 143 | } |
| 144 | |
| 145 | func Test_FormatApi(t *testing.T) { |
| 146 | contents := `package api |
nothing calls this directly
no test coverage detected
searching dependent graphs…