mirror of
https://github.com/aler9/gortsplib
synced 2025-11-02 11:24:05 +08:00
improve coverage
This commit is contained in:
23
pkg/multibuffer/multibuffer_test.go
Normal file
23
pkg/multibuffer/multibuffer_test.go
Normal file
@@ -0,0 +1,23 @@
|
||||
package multibuffer
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
func Test(t *testing.T) {
|
||||
mb := New(2, 4)
|
||||
|
||||
b := mb.Next()
|
||||
copy(b, []byte{0x01, 0x02, 0x03, 0x04})
|
||||
|
||||
b = mb.Next()
|
||||
copy(b, []byte{0x05, 0x06, 0x07, 0x08})
|
||||
|
||||
b = mb.Next()
|
||||
require.Equal(t, []byte{0x01, 0x02, 0x03, 0x04}, b)
|
||||
|
||||
b = mb.Next()
|
||||
require.Equal(t, []byte{0x05, 0x06, 0x07, 0x08}, b)
|
||||
}
|
||||
Reference in New Issue
Block a user