Skip to content

Commit

Permalink
Merge 6c386ae into a095b84
Browse files Browse the repository at this point in the history
  • Loading branch information
xincaosu committed Apr 3, 2018
2 parents a095b84 + 6c386ae commit 37f457e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion compression/rle/read_write.go
Expand Up @@ -68,7 +68,7 @@ func compressChunk(dat []byte) (ret []byte, n int) {
return []byte{token, tokenToken}, 1
case len(dat) > 1 && dat[0] == 0x0 && dat[1] == 0x0:
j := 0
for j <= 254 && j < len(dat) {
for j <= 249 && j < len(dat) {
if dat[j] != 0 {
break
}
Expand Down
7 changes: 7 additions & 0 deletions compression/rle/read_write_test.go
Expand Up @@ -48,3 +48,10 @@ func (s *CompressionRleSuite) TestDecompressSimple(c *checker.C) {
c.Assert(res, checker.DeepEquals, make([]byte, 10))

}

func (s *CompressionRleSuite) TestIdentity(c *checker.C) {
var exp []byte = make([]byte, 251)
res, err := Decompress(Compress(exp))
c.Assert(err, checker.IsNil)
c.Assert(res, checker.DeepEquals, exp)
}

0 comments on commit 37f457e

Please sign in to comment.