mirror of
https://github.com/bluenviron/mediamtx
synced 2024-12-12 18:00:12 +00:00
23 lines
439 B
Go
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())
|
|
})
|
|
}
|
|
}
|