(t *testing.T, comment SwaggerComment)
| 282 | var nonAlphanumericRegex = regexp.MustCompile(`[^a-zA-Z0-9-]+`) |
| 283 | |
| 284 | func assertConsistencyBetweenRouteIDAndSummary(t *testing.T, comment SwaggerComment) { |
| 285 | exp := strings.ToLower(comment.summary) |
| 286 | exp = strings.ReplaceAll(exp, " ", "-") |
| 287 | exp = nonAlphanumericRegex.ReplaceAllString(exp, "") |
| 288 | |
| 289 | assert.Equal(t, exp, comment.id, "Router ID must match summary") |
| 290 | } |
| 291 | |
| 292 | func assertSuccessOrFailureDefined(t *testing.T, comment SwaggerComment) { |
| 293 | assert.True(t, len(comment.successes) > 0 || len(comment.failures) > 0, "At least one @Success or @Failure annotation must be defined") |
no test coverage detected