Fix inflate.go's decompressing of a fixed Huffman block that has
length-distance pairs.
The new test data was generated by "gzip shesells.txt", which is
presumably what you (rsc) did before, for the other test cases in
gunzip_test.go.
R=rsc
APPROVED=rsc
DELTA=21 (17 added, 2 deleted, 2 changed)
OCL=33582
CL=33616
diff --git a/src/pkg/compress/gzip/gunzip_test.go b/src/pkg/compress/gzip/gunzip_test.go
index 49f6e9c..d881c98 100644
--- a/src/pkg/compress/gzip/gunzip_test.go
+++ b/src/pkg/compress/gzip/gunzip_test.go
@@ -8,8 +8,8 @@
"bytes";
"fmt";
"io";
- "testing";
"os";
+ "testing";
)
type gzipTest struct {
@@ -68,6 +68,22 @@
},
nil
},
+ gzipTest { // has a fixed huffman block with some length-distance pairs
+ "shesells.txt",
+ "shesells.txt",
+ "she sells seashells by the seashore\n",
+ []byte {
+ 0x1f, 0x8b, 0x08, 0x08, 0x72, 0x66, 0x8b, 0x4a,
+ 0x00, 0x03, 0x73, 0x68, 0x65, 0x73, 0x65, 0x6c,
+ 0x6c, 0x73, 0x2e, 0x74, 0x78, 0x74, 0x00, 0x2b,
+ 0xce, 0x48, 0x55, 0x28, 0x4e, 0xcd, 0xc9, 0x29,
+ 0x06, 0x92, 0x89, 0xc5, 0x19, 0x60, 0x56, 0x52,
+ 0xa5, 0x42, 0x09, 0x58, 0x18, 0x28, 0x90, 0x5f,
+ 0x94, 0xca, 0x05, 0x00, 0x76, 0xb0, 0x3b, 0xeb,
+ 0x24, 0x00, 0x00, 0x00,
+ },
+ nil
+ },
gzipTest { // has dynamic huffman blocks
"gettysburg",
"gettysburg",