improve coverage

This commit is contained in:
aler9
2022-08-16 10:24:36 +02:00
parent 8268c27bde
commit 155862f15b
4 changed files with 103 additions and 2 deletions

View File

@@ -92,6 +92,25 @@ func TestURLClone(t *testing.T) {
}, u2)
}
func TestURLCloneWithoutCredentials(t *testing.T) {
u := mustParse("rtsp://user:pass@localhost:8554/test/stream")
u2 := u.CloneWithoutCredentials()
u.Host = "otherhost"
require.Equal(t, &URL{
Scheme: "rtsp",
Host: "otherhost",
Path: "/test/stream",
User: url.UserPassword("user", "pass"),
}, u)
require.Equal(t, &URL{
Scheme: "rtsp",
Host: "localhost:8554",
Path: "/test/stream",
}, u2)
}
func TestURLRTSPPathAndQuery(t *testing.T) {
for _, ca := range []struct {
u *URL