优化结构

This commit is contained in:
Yvan
2026-08-27 16:20:37 +08:00
parent 001e39da50
commit 653414a1da
54 changed files with 1257 additions and 3450 deletions
+9
View File
@@ -28,6 +28,15 @@ func TestRoutePoliciesShareOneDescriptor(t *testing.T) {
}
}
func TestLookupMatchesWildcardTail(t *testing.T) {
if descriptor, ok := Lookup("GET", "/api/swagger/index.html"); !ok || !descriptor.Public || descriptor.Path != "/swagger/*any" {
t.Fatalf("wildcard descriptor = %#v, ok=%v", descriptor, ok)
}
if _, ok := Lookup("GET", "/api/swagger"); ok {
t.Fatal("wildcard route matched without a tail")
}
}
func TestEveryRouteHasAPIMetadata(t *testing.T) {
for _, descriptor := range Descriptors() {
if descriptor.Group == "" || descriptor.Description == "" {