Skip to content

Commit

Permalink
[bulk] Add extra empty payload decompression test
Browse files Browse the repository at this point in the history
  • Loading branch information
Viq111 committed Aug 24, 2023
1 parent 9c0d33f commit bf7b920
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion zstd_bullk_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ func TestBulkEmptyOrNilDictionary(t *testing.T) {
}
}

func TestBulkCompressEmptyOrNilContent(t *testing.T) {
func TestBulkCompressDecompressEmptyOrNilContent(t *testing.T) {
p := newBulkProcessor(t, dict, BestSpeed)
compressed, err := p.Compress(nil, nil)
if err != nil {
Expand All @@ -115,6 +115,14 @@ func TestBulkCompressEmptyOrNilContent(t *testing.T) {
if len(compressed) < 4 {
t.Error("magic number doesn't exist")
}

decompressed, err := p.Decompress(nil, compressed)
if err != nil {
t.Error("failed to decompress")
}
if len(decompressed) != 0 {
t.Error("content was not decompressed correctly")
}
}

func TestBulkCompressIntoGivenDestination(t *testing.T) {
Expand Down

0 comments on commit bf7b920

Please sign in to comment.