mirror of https://github.com/Xhofe/alist
25 lines
403 B
Go
25 lines
403 B
Go
|
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)
|
||
|
}
|
||
|
}
|
||
|
}
|