diff options
| author | 2025-11-16 00:00:00 +0000 | |
|---|---|---|
| committer | 2025-11-16 00:00:00 +0000 | |
| commit | 722cdf89ebafaf6bdc789176be5b5c2f6c98de08 (patch) | |
| tree | 410fcce6f03d7bf122e5210f8b375b23fedffde7 /pack_test.go | |
| parent | Rename ObjType enum (diff) | |
| signature | ||
Extract bufpool into its own package
Diffstat (limited to 'pack_test.go')
| -rw-r--r-- | pack_test.go | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/pack_test.go b/pack_test.go index 82176ae1..4d6f651f 100644 --- a/pack_test.go +++ b/pack_test.go @@ -5,6 +5,8 @@ import ( "compress/zlib" "encoding/binary" "testing" + + "git.sr.ht/~runxiyu/furgit/internal/bufpool" ) func compressBytes(t *testing.T, payload []byte) []byte { @@ -112,10 +114,10 @@ func TestPackVarintRead(t *testing.T) { } func TestPackDeltaApply(t *testing.T) { - base := borrowedFromOwned([]byte("abcdefghij")) + base := bufpool.FromOwned([]byte("abcdefghij")) defer base.Release() deltaBytes := []byte{0x0a, 0x0a, 0x91, 0x00, 0x03, 0x03, 'X', 'Y', 'Z', 0x91, 0x06, 0x04} - delta := borrowedFromOwned(deltaBytes) + delta := bufpool.FromOwned(deltaBytes) defer delta.Release() out, err := packDeltaApply(base, delta) if err != nil { @@ -128,9 +130,9 @@ func TestPackDeltaApply(t *testing.T) { } func TestPackDeltaApplyMismatchedBaseSize(t *testing.T) { - base := borrowedFromOwned([]byte("abc")) + base := bufpool.FromOwned([]byte("abc")) defer base.Release() - delta := borrowedFromOwned([]byte{0x04, 0x04}) + delta := bufpool.FromOwned([]byte{0x04, 0x04}) defer delta.Release() if _, err := packDeltaApply(base, delta); err == nil { t.Fatal("expected error for mismatched base size") |
