working commit

This commit is contained in:
2026-03-06 16:26:24 +02:00
parent ef9a3f6b20
commit 82550622be
12 changed files with 347 additions and 0 deletions
+28
View File
@@ -0,0 +1,28 @@
package repocli
import (
"github.com/stretchr/testify/require"
"bytes"
"context"
"fmt"
"math/rand"
"testing"
)
func TestCopy(t *testing.T) {
srcsize := 1024 + 145
srcdata := make([]byte, srcsize)
_, err := rand.Read(srcdata)
require.NoError(t, err)
src := bytes.NewReader(srcdata)
dst := bytes.NewBuffer(nil)
ctx := context.Background()
recsize, err := Copy(ctx, dst, src)
require.NoError(t, err)
fmt.Printf("Size: %d %d\n", recsize, srcsize)
require.Equal(t, int64(srcsize), recsize)
}