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:
2026-03-18 18:16:26 +09:00
parent 68cec9f18f
commit e60f36b985
3 changed files with 276 additions and 0 deletions

31
streamdata_test.go Normal file
View 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)
}
})
}
}