mirror of
https://github.com/datarhei/core.git
synced 2025-09-27 04:16:25 +08:00

Commits (Ingo Oppermann): - Add experimental SRT connection stats and logs - Hide /config/reload endpoint in reade-only mode - Add SRT server - Create v16 in go.mod - Fix data races, tests, lint, and update dependencies - Add trailing slash for routed directories (datarhei/restreamer#340) - Allow relative URLs in content in static routes Co-Authored-By: Ingo Oppermann <57445+ioppermann@users.noreply.github.com>
27 lines
765 B
Go
27 lines
765 B
Go
package srt
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/require"
|
|
)
|
|
|
|
func TestParseStreamId(t *testing.T) {
|
|
streamids := map[string]streamInfo{
|
|
"bla": {},
|
|
"#!:": {},
|
|
"#!:key=value": {},
|
|
"#!:m=publish": {mode: "publish"},
|
|
"#!:r=123456789": {resource: "123456789"},
|
|
"#!:token=foobar": {token: "foobar"},
|
|
"#!:token=foo,bar": {token: "foo"},
|
|
"#!:m=publish,r=123456789,token=foobar": {mode: "publish", resource: "123456789", token: "foobar"},
|
|
}
|
|
|
|
for streamid, wantsi := range streamids {
|
|
si, _ := parseStreamId(streamid)
|
|
|
|
require.Equal(t, wantsi, si)
|
|
}
|
|
}
|