mirror of https://github.com/gofiber/fiber.git
♻️ Refactor: Remove outdated test cases from path_testcases_test.go and clean up CheckConstraint method in path.go
parent
3b199a76a0
commit
113746a227
2
path.go
2
path.go
|
@ -783,8 +783,6 @@ func (c *Constraint) CheckConstraint(param string) bool {
|
||||||
if match := c.RegexCompiler.MatchString(param); !match {
|
if match := c.RegexCompiler.MatchString(param); !match {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
default:
|
|
||||||
return false
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return err == nil
|
return err == nil
|
||||||
|
|
|
@ -721,20 +721,6 @@ func init() {
|
||||||
{url: "/api/v1/abc", params: nil, match: false},
|
{url: "/api/v1/abc", params: nil, match: false},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
// Add test case for default branch (unknown constraint type)
|
|
||||||
{
|
|
||||||
pattern: "/api/v1/:param<unknownconstraint>",
|
|
||||||
testCases: []routeTestCase{
|
|
||||||
{url: "/api/v1/anyvalue", params: nil, match: false},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
// Test case for constraint with insufficient data
|
|
||||||
{
|
|
||||||
pattern: "/api/v1/:param<minLen>",
|
|
||||||
testCases: []routeTestCase{
|
|
||||||
{url: "/api/v1/anyvalue", params: nil, match: false},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
}...,
|
}...,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue