mirror of
https://github.com/AlistGo/alist.git
synced 2025-06-07 19:34:39 +08:00
fix: path IsApply
check (close #3784)
This commit is contained in:
24
server/common/check_test.go
Normal file
24
server/common/check_test.go
Normal 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)
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user