You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
lal/pkg/rtsp/server_test.go

28 lines
746 B
Go

// Copyright 2020, Chef. All rights reserved.
// https://github.com/q191201771/lal
//
// Use of this source code is governed by a MIT-style license
// that can be found in the License file.
//
// Author: Chef (191201771@qq.com)
package rtsp
import (
"testing"
"github.com/q191201771/naza/pkg/assert"
)
func Test_parsePresentation(t *testing.T) {
ret, err := parsePresentation("rtsp://localhost:5544/test110")
assert.Equal(t, "test110", ret)
assert.Equal(t, nil, err)
ret, err = parsePresentation("rtsp://localhost:5544/live/test110")
assert.Equal(t, "test110", ret)
assert.Equal(t, nil, err)
ret, err = parsePresentation("rtsp://localhost:5544/live/test110/streamid=0")
assert.Equal(t, "test110", ret)
assert.Equal(t, nil, err)
}