improve coverage

This commit is contained in:
aler9
2021-05-12 16:03:15 +02:00
parent 4d1c2d1831
commit 8be64d9cf6
8 changed files with 123 additions and 19 deletions

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