From b8c043780d38280fccc0e6b4b5aa5b22d2ef1eff Mon Sep 17 00:00:00 2001 From: Jack Christensen Date: Sat, 20 May 2017 09:46:06 -0500 Subject: [PATCH] Fix shopsprint-numeric test --- pgtype/ext/shopspring-numeric/decimal_test.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/pgtype/ext/shopspring-numeric/decimal_test.go b/pgtype/ext/shopspring-numeric/decimal_test.go index 08483dda..79121ef3 100644 --- a/pgtype/ext/shopspring-numeric/decimal_test.go +++ b/pgtype/ext/shopspring-numeric/decimal_test.go @@ -22,7 +22,7 @@ func mustParseDecimal(t *testing.T, src string) decimal.Decimal { } func TestNumericNormalize(t *testing.T) { - testutil.TestSuccessfulNormalize(t, []testutil.NormalizeTest{ + testutil.TestSuccessfulNormalizeEqFunc(t, []testutil.NormalizeTest{ { SQL: "select '0'::numeric", Value: &shopspring.Numeric{Decimal: mustParseDecimal(t, "0"), Status: pgtype.Present}, @@ -84,6 +84,11 @@ func TestNumericNormalize(t *testing.T) { Status: pgtype.Present, }, }, + }, func(aa, bb interface{}) bool { + a := aa.(shopspring.Numeric) + b := bb.(shopspring.Numeric) + + return a.Status == b.Status && a.Decimal.Equal(b.Decimal) }) }