aboutsummaryrefslogtreecommitdiffstats
path: root/compression/rle/read_write_test.go
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2014-11-03 07:29:34 +0800
committerobscuren <geffobscura@gmail.com>2014-11-03 07:29:34 +0800
commit5dcf59bdf4b1a63ca8733994a81c936becf59933 (patch)
tree6ba094a7ddd67466dd14cbd002b59b14dfe5164e /compression/rle/read_write_test.go
parent9f8bcf3abca8c6c32efc384f6c6eda1677b769c5 (diff)
downloaddexon-5dcf59bdf4b1a63ca8733994a81c936becf59933.tar
dexon-5dcf59bdf4b1a63ca8733994a81c936becf59933.tar.gz
dexon-5dcf59bdf4b1a63ca8733994a81c936becf59933.tar.bz2
dexon-5dcf59bdf4b1a63ca8733994a81c936becf59933.tar.lz
dexon-5dcf59bdf4b1a63ca8733994a81c936becf59933.tar.xz
dexon-5dcf59bdf4b1a63ca8733994a81c936becf59933.tar.zst
dexon-5dcf59bdf4b1a63ca8733994a81c936becf59933.zip
Forgot to put in regular bytes during decompression
Diffstat (limited to 'compression/rle/read_write_test.go')
-rw-r--r--compression/rle/read_write_test.go22
1 files changed, 22 insertions, 0 deletions
diff --git a/compression/rle/read_write_test.go b/compression/rle/read_write_test.go
index 944822a47..76ceb6350 100644
--- a/compression/rle/read_write_test.go
+++ b/compression/rle/read_write_test.go
@@ -91,3 +91,25 @@ func TestCompressMulti(t *testing.T) {
t.Error("expected", exp, "got", res)
}
}
+
+func TestCompressDecompress(t *testing.T) {
+ var in []byte
+
+ for i := 0; i < 20; i++ {
+ in = append(in, []byte{0, 0, 0, 0, 0}...)
+ in = append(in, crypto.Sha3([]byte(""))...)
+ in = append(in, crypto.Sha3([]byte{0x80})...)
+ in = append(in, []byte{123, 2, 19, 89, 245, 254, 255, token, 98, 233}...)
+ in = append(in, token)
+ }
+
+ c := Compress(in)
+ d, err := Decompress(c)
+ if err != nil {
+ t.Error(err)
+ }
+
+ if bytes.Compare(d, in) != 0 {
+ t.Error("multi failed\n", d, "\n", in)
+ }
+}