@@ -1,6 +1,7 @@
|
||||
package pgtype_test
|
||||
|
||||
import (
|
||||
"math"
|
||||
"math/big"
|
||||
"reflect"
|
||||
"testing"
|
||||
@@ -65,6 +66,13 @@ func TestNumericArraySet(t *testing.T) {
|
||||
Dimensions: []pgtype.ArrayDimension{{LowerBound: 1, Length: 1}},
|
||||
Status: pgtype.Present},
|
||||
},
|
||||
{
|
||||
source: []float32{float32(math.Copysign(0, -1))},
|
||||
result: pgtype.NumericArray{
|
||||
Elements: []pgtype.Numeric{{Int: big.NewInt(0), Status: pgtype.Present}},
|
||||
Dimensions: []pgtype.ArrayDimension{{LowerBound: 1, Length: 1}},
|
||||
Status: pgtype.Present},
|
||||
},
|
||||
{
|
||||
source: []float64{1},
|
||||
result: pgtype.NumericArray{
|
||||
@@ -72,6 +80,13 @@ func TestNumericArraySet(t *testing.T) {
|
||||
Dimensions: []pgtype.ArrayDimension{{LowerBound: 1, Length: 1}},
|
||||
Status: pgtype.Present},
|
||||
},
|
||||
{
|
||||
source: []float64{math.Copysign(0, -1)},
|
||||
result: pgtype.NumericArray{
|
||||
Elements: []pgtype.Numeric{{Int: big.NewInt(0), Status: pgtype.Present}},
|
||||
Dimensions: []pgtype.ArrayDimension{{LowerBound: 1, Length: 1}},
|
||||
Status: pgtype.Present},
|
||||
},
|
||||
{
|
||||
source: (([]float32)(nil)),
|
||||
result: pgtype.NumericArray{Status: pgtype.Null},
|
||||
|
||||
Reference in New Issue
Block a user