2
0

Fix parsing text array with negative bounds

e.g. '[-4:-2]={1,2,3}'

fixes #132
This commit is contained in:
Jack Christensen
2021-10-30 09:00:48 -05:00
parent b72f8084b5
commit 2caf113f1b
2 changed files with 9 additions and 1 deletions
+8
View File
@@ -100,6 +100,14 @@ func TestParseUntypedTextArray(t *testing.T) {
},
},
},
{
source: "[-4:-2]={1,2,3}",
result: pgtype.UntypedTextArray{
Elements: []string{"1", "2", "3"},
Quoted: []bool{false, false, false},
Dimensions: []pgtype.ArrayDimension{{Length: 3, LowerBound: -4}},
},
},
}
for i, tt := range tests {