From c0a4d1b9ce701620652eb27cf73bf86891616976 Mon Sep 17 00:00:00 2001 From: Jack Christensen Date: Mon, 20 Jun 2022 20:43:56 -0500 Subject: [PATCH] Add a few tests --- pgtype/numeric_test.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pgtype/numeric_test.go b/pgtype/numeric_test.go index 14225e92..693fe6f2 100644 --- a/pgtype/numeric_test.go +++ b/pgtype/numeric_test.go @@ -113,6 +113,10 @@ func TestNumericCodec(t *testing.T) { {"1.23", new(string), isExpectedEq("1.23")}, {pgtype.Numeric{}, new(pgtype.Numeric), isExpectedEq(pgtype.Numeric{})}, {nil, new(pgtype.Numeric), isExpectedEq(pgtype.Numeric{})}, + {mustParseNumeric(t, "1"), new(string), isExpectedEq("1")}, + {pgtype.Numeric{NaN: true, Valid: true}, new(string), isExpectedEq("NaN")}, + {pgtype.Numeric{InfinityModifier: pgtype.Infinity, Valid: true}, new(string), isExpectedEq("Infinity")}, + {pgtype.Numeric{InfinityModifier: pgtype.NegativeInfinity, Valid: true}, new(string), isExpectedEq("-Infinity")}, }) pgxtest.RunValueRoundTripTests(context.Background(), t, defaultConnTestRunner, nil, "int8", []pgxtest.ValueRoundTripTest{