Files
huangguo_server/app/router/iteration_routes_test.go
rootandClaude Opus 5 8679200f41 Initial commit
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-15 13:57:10 +08:00

33 lines
708 B
Go

package router
import (
"testing"
"github.com/gin-gonic/gin"
)
func TestIterationAppRoutes(t *testing.T) {
gin.SetMode(gin.TestMode)
engine := gin.New()
group := engine.Group("/api/app")
vidRouter(group)
paymentGuideRouter(group)
sceneBannerRouter(group)
routes := make(map[string]struct{})
for _, route := range engine.Routes() {
routes[route.Method+" "+route.Path] = struct{}{}
}
expected := []string{
"GET /api/app/vid/module/:subModuleID/refresh",
"GET /api/app/payment/guide",
"POST /api/app/payment/guide/impression",
"GET /api/app/banner/list",
}
for _, route := range expected {
if _, ok := routes[route]; !ok {
t.Errorf("route %q is not registered", route)
}
}
}