Files
streamdata/streamdata_test.go
Yonah e60f36b985 ident: decode twitch vod name
There are a few unknown fields, represented as is for now.

Signed-off-by: Yonah <contrib@gensokyo.uk>
2026-03-18 18:16:26 +09:00

32 lines
632 B
Go

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)
}
})
}
}