2
0

Add remaining int array conversions

This commit is contained in:
Jack Christensen
2019-11-27 20:23:43 -06:00
parent 52cb969ea1
commit 038f263a44
6 changed files with 339 additions and 3 deletions
+14
View File
@@ -73,6 +73,13 @@ func TestInt4ArraySet(t *testing.T) {
Dimensions: []pgtype.ArrayDimension{{LowerBound: 1, Length: 1}},
Status: pgtype.Present},
},
{
source: []int16{1},
result: pgtype.Int4Array{
Elements: []pgtype.Int4{{Int: 1, Status: pgtype.Present}},
Dimensions: []pgtype.ArrayDimension{{LowerBound: 1, Length: 1}},
Status: pgtype.Present},
},
{
source: []int{1},
result: pgtype.Int4Array{
@@ -98,6 +105,13 @@ func TestInt4ArraySet(t *testing.T) {
Dimensions: []pgtype.ArrayDimension{{LowerBound: 1, Length: 1}},
Status: pgtype.Present},
},
{
source: []uint16{1},
result: pgtype.Int4Array{
Elements: []pgtype.Int4{{Int: 1, Status: pgtype.Present}},
Dimensions: []pgtype.ArrayDimension{{LowerBound: 1, Length: 1}},
Status: pgtype.Present},
},
{
source: (([]int32)(nil)),
result: pgtype.Int4Array{Status: pgtype.Null},