fix: path IsApply check (close #3784)

This commit is contained in:
Andy Hsu
2023-03-09 21:03:56 +08:00
parent 02d0aef611
commit 43de823058
2 changed files with 25 additions and 1 deletions

View File

@ -0,0 +1,24 @@
package common
import "testing"
func TestIsApply(t *testing.T) {
datas := []struct {
metaPath string
reqPath string
applySub bool
result bool
}{
{
metaPath: "/",
reqPath: "/test",
applySub: true,
result: true,
},
}
for i, data := range datas {
if IsApply(data.metaPath, data.reqPath, data.applySub) != data.result {
t.Errorf("TestIsApply %d failed", i)
}
}
}