Skip to content

Commit 50324e8

Browse files
Apply review comments
1 parent 0df4924 commit 50324e8

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

marshal.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1785,7 +1785,7 @@ func unmarshalVector(info VectorType, data []byte, value interface{}) error {
17851785
}
17861786
if k == reflect.Array {
17871787
if rv.Len() != info.Dimensions {
1788-
return unmarshalErrorf("unmarshal vector: array with wrong size")
1788+
return unmarshalErrorf("unmarshal vector: array of size %d cannot store vector of %d dimensions", rv.Len(), info.Dimensions)
17891789
}
17901790
} else {
17911791
rv.Set(reflect.MakeSlice(t, info.Dimensions, info.Dimensions))

vector_test.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -153,8 +153,7 @@ func TestVector_Types(t *testing.T) {
153153
actual := a.([]net.IP)
154154
assertEqual(t, "vector size", len(expected), len(actual))
155155
for i, _ := range expected {
156-
// TODO(lantoniak): Find a better way to compare IP addresses
157-
assertEqual(t, "vector", expected[i].String(), actual[i].String())
156+
assertTrue(t, "vector", expected[i].Equal(actual[i]))
158157
}
159158
},
160159
},
@@ -163,7 +162,6 @@ func TestVector_Types(t *testing.T) {
163162
{name: "smallint", cqlType: TypeSmallInt.String(), value: []int16{127, 256, -1234}},
164163
{name: "tinyint", cqlType: TypeTinyInt.String(), value: []int8{127, 9, -123}},
165164
{name: "duration", cqlType: TypeDuration.String(), value: []Duration{duration1, duration2, duration3}},
166-
// TODO(lantonia): Test vector of custom types
167165
{name: "vector_vector_float", cqlType: "vector<float, 5>", value: [][]float32{{0.1, -1.2, 3, 5, 5}, {10.1, -122222.0002, 35.0, 1, 1}, {0, 0, 0, 0, 0}}},
168166
{name: "vector_vector_set_float", cqlType: "vector<set<float>, 5>", value: [][][]float32{
169167
{{1, 2}, {2, -1}, {3}, {0}, {-1.3}},

0 commit comments

Comments
 (0)