@@ -81,15 +81,16 @@ func TestBsonBinaryVectorSpec(t *testing.T) {
8181 })
8282}
8383
84- func convertSlice [T int8 | float32 | byte ](t * testing.T , data []byte ) []T {
84+ func decodeTestSlice [T int8 | float32 | byte ](t * testing.T , data []byte ) []T {
85+ t .Helper ()
86+
8587 if len (data ) == 0 {
8688 return nil
8789 }
8890 var s []float64
8991 err := UnmarshalExtJSON (data , true , & s )
90- if err != nil {
91- t .Fatalf ("got %q while handling %s" , err , string (data ))
92- }
92+ require .NoError (t , err )
93+
9394 v := make ([]T , len (s ))
9495 for i , e := range s {
9596 v [i ] = T (e )
@@ -103,17 +104,17 @@ func runBsonBinaryVectorTest(t *testing.T, testKey string, test bsonBinaryVector
103104 case "0x03" :
104105 testVector [testKey ] = Vector {
105106 dType : Int8Vector ,
106- int8Data : convertSlice [int8 ](t , test .Vector ),
107+ int8Data : decodeTestSlice [int8 ](t , test .Vector ),
107108 }
108109 case "0x27" :
109110 testVector [testKey ] = Vector {
110111 dType : Float32Vector ,
111- float32Data : convertSlice [float32 ](t , test .Vector ),
112+ float32Data : decodeTestSlice [float32 ](t , test .Vector ),
112113 }
113114 case "0x10" :
114115 testVector [testKey ] = Vector {
115116 dType : PackedBitVector ,
116- bitData : convertSlice [byte ](t , test .Vector ),
117+ bitData : decodeTestSlice [byte ](t , test .Vector ),
117118 bitPadding : uint8 (test .Padding ),
118119 }
119120 default :
0 commit comments