mediamtx/internal/rtmp/message/writer_test.go
2023-05-16 16:14:20 +02:00

23 lines
439 B
Go

package message
import (
"bytes"
"testing"
"github.com/stretchr/testify/require"
"github.com/bluenviron/mediamtx/internal/rtmp/bytecounter"
)
func TestWriter(t *testing.T) {
for _, ca := range readWriterCases {
t.Run(ca.name, func(t *testing.T) {
var buf bytes.Buffer
r := NewWriter(bytecounter.NewWriter(&buf), true)
err := r.Write(ca.dec)
require.NoError(t, err)
require.Equal(t, ca.enc, buf.Bytes())
})
}
}