Merge #5855 (issue: #5854).

RHS merges cleanly with 0.10.0

Signed-off-by: Jon Seymour <jon@wildducktheories.com>
pull/5855/head
Jon Seymour 2016-02-29 20:37:32 +11:00
commit 73b3a2a056
4 changed files with 27 additions and 8 deletions

View File

@ -76,6 +76,10 @@ func Test_BooleanEncoder_Multi_Compressed(t *testing.T) {
func Test_BooleanEncoder_Quick(t *testing.T) {
if err := quick.Check(func(values []bool) bool {
expected := values
if values == nil {
expected = []bool{}
}
// Write values to encoder.
enc := tsm1.NewBooleanEncoder()
for _, v := range values {
@ -96,8 +100,8 @@ func Test_BooleanEncoder_Quick(t *testing.T) {
}
// Verify that input and output values match.
if !reflect.DeepEqual(values, got) {
t.Fatalf("mismatch:\n\nexp=%+v\n\ngot=%+v\n\n", values, got)
if !reflect.DeepEqual(expected, got) {
t.Fatalf("mismatch:\n\nexp=%#v\n\ngot=%#v\n\n", expected, got)
}
return true

View File

@ -202,6 +202,12 @@ func TestFloatEncoder_Roundtrip_NaN(t *testing.T) {
func Test_FloatEncoder_Quick(t *testing.T) {
quick.Check(func(values []float64) bool {
expected := values
if values == nil {
expected = []float64{}
}
// Write values to encoder.
enc := tsm1.NewFloatEncoder()
for _, v := range values {
@ -225,8 +231,8 @@ func Test_FloatEncoder_Quick(t *testing.T) {
}
// Verify that input and output values match.
if !reflect.DeepEqual(values, got) {
t.Fatalf("mismatch:\n\nexp=%+v\n\ngot=%+v\n\n", values, got)
if !reflect.DeepEqual(expected, got) {
t.Fatalf("mismatch:\n\nexp=%#v\n\ngot=%#v\n\n", expected, got)
}
return true

View File

@ -416,6 +416,11 @@ func Test_IntegerEncoder_MinMax(t *testing.T) {
func Test_IntegerEncoder_Quick(t *testing.T) {
quick.Check(func(values []int64) bool {
expected := values
if values == nil {
expected = []int64{} // is this really expected?
}
// Write values to encoder.
enc := NewIntegerEncoder()
for _, v := range values {
@ -439,8 +444,8 @@ func Test_IntegerEncoder_Quick(t *testing.T) {
}
// Verify that input and output values match.
if !reflect.DeepEqual(values, got) {
t.Fatalf("mismatch:\n\nexp=%+v\n\ngot=%+v\n\n", values, got)
if !reflect.DeepEqual(expected, got) {
t.Fatalf("mismatch:\n\nexp=%#v\n\ngot=%#v\n\n", expected, got)
}
return true

View File

@ -88,6 +88,10 @@ func Test_StringEncoder_Multi_Compressed(t *testing.T) {
func Test_StringEncoder_Quick(t *testing.T) {
quick.Check(func(values []string) bool {
expected := values
if values == nil {
expected = []string{}
}
// Write values to encoder.
enc := NewStringEncoder()
for _, v := range values {
@ -114,8 +118,8 @@ func Test_StringEncoder_Quick(t *testing.T) {
}
// Verify that input and output values match.
if !reflect.DeepEqual(values, got) {
t.Fatalf("mismatch:\n\nexp=%+v\n\ngot=%+v\n\n", values, got)
if !reflect.DeepEqual(expected, got) {
t.Fatalf("mismatch:\n\nexp=%#v\n\ngot=%#v\n\n", expected, got)
}
return true