mirror of
https://github.com/aler9/rtsp-simple-server
synced 2025-10-27 01:30:25 +08:00
rtmp: add tests
This commit is contained in:
15
internal/rtmp/bytecounter/writer_test.go
Normal file
15
internal/rtmp/bytecounter/writer_test.go
Normal file
@@ -0,0 +1,15 @@
|
||||
package bytecounter
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
func TestWriter(t *testing.T) {
|
||||
var buf bytes.Buffer
|
||||
w := NewWriter(&buf)
|
||||
w.Write(bytes.Repeat([]byte{0x01}, 64))
|
||||
require.Equal(t, uint32(64), w.Count())
|
||||
}
|
||||
Reference in New Issue
Block a user