mirror of
https://github.com/aler9/gortsplib
synced 2025-10-04 23:02:45 +08:00
headers: add negative unit tests
This commit is contained in:
@@ -191,20 +191,23 @@ func TestRTPInfoReadError(t *testing.T) {
|
||||
for _, ca := range []struct {
|
||||
name string
|
||||
hv base.HeaderValue
|
||||
err string
|
||||
}{
|
||||
{
|
||||
"empty",
|
||||
base.HeaderValue{},
|
||||
"value not provided",
|
||||
},
|
||||
{
|
||||
"2 values",
|
||||
base.HeaderValue{"a", "b"},
|
||||
"value provided multiple times ([a b])",
|
||||
},
|
||||
} {
|
||||
t.Run(ca.name, func(t *testing.T) {
|
||||
var h RTPInfo
|
||||
err := h.Read(ca.hv)
|
||||
require.Error(t, err)
|
||||
require.Equal(t, ca.err, err.Error())
|
||||
})
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user