aboutsummaryrefslogtreecommitdiff
path: root/internal/compress/zlib/reader_test.go
diff options
context:
space:
mode:
authorGravatar Runxi Yu2026-03-05 21:30:38 +0800
committerGravatar Runxi Yu2026-03-05 21:30:38 +0800
commit9ab5800ec4f9d9aac97cb4bb2ae9f0f8dd488678 (patch)
treecf54c700e28c77a12b98baf34629662b866c862b /internal/compress/zlib/reader_test.go
parent*: Fix various lints (diff)
signatureNo signature
internal/compress/zlib: Fix testpkg
Diffstat (limited to 'internal/compress/zlib/reader_test.go')
-rw-r--r--internal/compress/zlib/reader_test.go14
1 files changed, 8 insertions, 6 deletions
diff --git a/internal/compress/zlib/reader_test.go b/internal/compress/zlib/reader_test.go
index 13f32dbc..c64bd5b0 100644
--- a/internal/compress/zlib/reader_test.go
+++ b/internal/compress/zlib/reader_test.go
@@ -2,13 +2,15 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-package zlib
+package zlib_test
import (
"bytes"
"errors"
"io"
"testing"
+
+ "codeberg.org/lindenii/furgit/internal/compress/zlib"
)
type zlibTest struct {
@@ -71,21 +73,21 @@ var zlibTests = []zlibTest{
"",
[]byte{0x88, 0x98, 0x03, 0x00, 0x00, 0x00, 0x00, 0x01},
nil,
- ErrHeader,
+ zlib.ErrHeader,
},
{
"bad header (FCHECK)",
"",
[]byte{0x78, 0x9f, 0x03, 0x00, 0x00, 0x00, 0x00, 0x01},
nil,
- ErrHeader,
+ zlib.ErrHeader,
},
{
"bad checksum",
"",
[]byte{0x78, 0x9c, 0x03, 0x00, 0x00, 0x00, 0x00, 0xff},
nil,
- ErrChecksum,
+ zlib.ErrChecksum,
},
{
"not enough data",
@@ -128,7 +130,7 @@ var zlibTests = []zlibTest{
[]byte{
0x48, 0x65, 0x6c, 0x6c,
},
- ErrDictionary,
+ zlib.ErrDictionary,
},
{
"truncated zlib stream amid raw-block",
@@ -157,7 +159,7 @@ func TestDecompressor(t *testing.T) {
for _, tt := range zlibTests {
in := bytes.NewReader(tt.compressed)
- zr, err := NewReaderDict(in, tt.dict)
+ zr, err := zlib.NewReaderDict(in, tt.dict)
if err != nil {
if !errors.Is(err, tt.err) {
t.Errorf("%s: NewReader: %s", tt.desc, err)