cache_test.go
411 字节
package cachex
import "testing"
func TestKeyMatch3(t *testing.T) {
inputObject := []struct {
ReqObject string
CmpObject string
Result bool
}{
{
"/a/b",
"/a/b",
true,
},
{
"/v1/a/b",
"/a/b",
true,
},
}
for _, v := range inputObject {
if KeyMatch3(v.ReqObject, v.CmpObject) != v.Result {
t.Fatal(v.ReqObject, " not match ", v.CmpObject, "except:", v.Result)
}
}
}