ident: decode twitch vod name
There are a few unknown fields, represented as is for now. Signed-off-by: Yonah <contrib@gensokyo.uk>
This commit is contained in:
31
streamdata_test.go
Normal file
31
streamdata_test.go
Normal file
@@ -0,0 +1,31 @@
|
||||
package streamdata_test
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"git.gensokyo.uk/yonah/streamdata"
|
||||
)
|
||||
|
||||
func TestErrors(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
testCases := []struct {
|
||||
name string
|
||||
err error
|
||||
want string
|
||||
}{
|
||||
{"IdentFieldError", streamdata.IdentFieldError(0xcafe),
|
||||
"got 51966 field(s) instead of 7"},
|
||||
{"IdentFFError", &streamdata.IdentFFError{Got: 0xcafe, Want: 0xbabe},
|
||||
"got 51966 bytes for a 47806-byte long free-form field"},
|
||||
}
|
||||
for _, tc := range testCases {
|
||||
t.Run(tc.name, func(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
if got := tc.err.Error(); got != tc.want {
|
||||
t.Errorf("Error: %q, want %q", got, tc.want)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user