working commit

This commit is contained in:
2026-02-27 03:14:24 +02:00
parent 19b173357a
commit 7de22e3816
19 changed files with 827 additions and 150 deletions
+28
View File
@@ -0,0 +1,28 @@
package client
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)
}