♻️ Refactor: Remove outdated test cases from path_testcases_test.go and clean up CheckConstraint method in path.go

pull/3356/head
JIeJaitt 2025-03-19 17:39:46 +08:00
parent 3b199a76a0
commit 113746a227
2 changed files with 0 additions and 16 deletions

View File

@ -783,8 +783,6 @@ func (c *Constraint) CheckConstraint(param string) bool {
if match := c.RegexCompiler.MatchString(param); !match {
return false
}
default:
return false
}
return err == nil

View File

@ -721,20 +721,6 @@ func init() {
{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},
},
},
}...,
)
}