Browse Source

testing more options

Pierre.Curto 5 years ago
parent
commit
55dd081051
1 changed files with 9 additions and 2 deletions
  1. 9 2
      writer_test.go

+ 9 - 2
writer_test.go

@@ -7,6 +7,7 @@ import (
 	"io/ioutil"
 	"os"
 	"reflect"
+	"strings"
 	"testing"
 
 	"github.com/pierrec/lz4"
@@ -28,8 +29,8 @@ func TestWriter(t *testing.T) {
 	for _, fname := range goldenFiles {
 		for _, option := range []lz4.Option{
 			lz4.ConcurrencyOption(1),
-			//lz4.BlockChecksumOption(true),
-			//lz4.SizeOption(123),
+			lz4.BlockChecksumOption(true),
+			lz4.SizeOption(123),
 			//lz4.ConcurrencyOption(2),
 		} {
 			label := fmt.Sprintf("%s/%s", fname, option)
@@ -74,6 +75,12 @@ func TestWriter(t *testing.T) {
 				if got, want := out.Bytes(), raw; !reflect.DeepEqual(got, want) {
 					t.Fatal("uncompressed data does not match original")
 				}
+
+				if strings.Contains(option.String(), "SizeOption") {
+					if got, want := zr.Size(), 123; got != want {
+						t.Errorf("invalid sizes: got %d; want %d", got, want)
+					}
+				}
 			})
 		}
 	}