mirror of
https://github.com/Monibuca/plugin-hdl.git
synced 2025-10-30 11:36:21 +08:00
新增TLS端口监听和服用网关端口功能
This commit is contained in:
23
main_test.go
Normal file
23
main_test.go
Normal file
@@ -0,0 +1,23 @@
|
||||
package hdl
|
||||
|
||||
import (
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestHDLHandler(t *testing.T) {
|
||||
tests := map[string]string{
|
||||
"/hdl/abc.flv": "abc", "/hdl/abc": "abc", "/abc": "abc", "/abc.flv": "abc",
|
||||
}
|
||||
for name, result := range tests {
|
||||
t.Run(name, func(t *testing.T) {
|
||||
parts := streamPathReg.FindStringSubmatch(name)
|
||||
stringPath := parts[3]
|
||||
if stringPath == "" {
|
||||
stringPath = parts[5]
|
||||
}
|
||||
if stringPath != result {
|
||||
t.Fail()
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user