优化结构
This commit is contained in:
@@ -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 == "" {
|
||||
|
||||
Reference in New Issue
Block a user