@@ -15,9 +15,10 @@ import (
15
15
"testing"
16
16
17
17
"go.mongodb.org/mongo-driver/v2/internal/require"
18
+ "go.mongodb.org/mongo-driver/v2/internal/spectest"
18
19
)
19
20
20
- const bsonBinaryVectorDir = "../testdata/ bson-binary-vector/"
21
+ var bsonBinaryVectorDir = spectest . Path ( " bson-binary-vector" )
21
22
22
23
type bsonBinaryVectorTests struct {
23
24
Description string `json:"description"`
@@ -128,18 +129,7 @@ func runBsonBinaryVectorTest(t *testing.T, testKey string, test bsonBinaryVector
128
129
require .NoError (t , err , "decoding canonical BSON" )
129
130
130
131
t .Run ("Unmarshaling" , func (t * testing.T ) {
131
- skipCases := map [string ]string {
132
- "Overflow Vector INT8" : "compile-time restriction" ,
133
- "Underflow Vector INT8" : "compile-time restriction" ,
134
- "INT8 with float inputs" : "compile-time restriction" ,
135
- "Overflow Vector PACKED_BIT" : "compile-time restriction" ,
136
- "Underflow Vector PACKED_BIT" : "compile-time restriction" ,
137
- "Vector with float values PACKED_BIT" : "compile-time restriction" ,
138
- "Negative padding PACKED_BIT" : "compile-time restriction" ,
139
- }
140
- if reason , ok := skipCases [test .Description ]; ok {
141
- t .Skipf ("skip test case %s: %s" , test .Description , reason )
142
- }
132
+ spectest .CheckSkip (t )
143
133
144
134
errMap := map [string ]string {
145
135
"FLOAT32 with padding" : "padding must be 0" ,
@@ -163,24 +153,7 @@ func runBsonBinaryVectorTest(t *testing.T, testKey string, test bsonBinaryVector
163
153
})
164
154
165
155
t .Run ("Marshaling" , func (t * testing.T ) {
166
- skipCases := map [string ]string {
167
- "FLOAT32 with padding" : "private padding field" ,
168
- "Insufficient vector data with 3 bytes FLOAT32" : "invalid case" ,
169
- "Insufficient vector data with 5 bytes FLOAT32" : "invalid case" ,
170
- "Overflow Vector INT8" : "compile-time restriction" ,
171
- "Underflow Vector INT8" : "compile-time restriction" ,
172
- "INT8 with padding" : "private padding field" ,
173
- "INT8 with float inputs" : "compile-time restriction" ,
174
- "Overflow Vector PACKED_BIT" : "compile-time restriction" ,
175
- "Underflow Vector PACKED_BIT" : "compile-time restriction" ,
176
- "Vector with float values PACKED_BIT" : "compile-time restriction" ,
177
- "Padding specified with no vector data PACKED_BIT" : "run in alternative case" ,
178
- "Exceeding maximum padding PACKED_BIT" : "run in alternative case" ,
179
- "Negative padding PACKED_BIT" : "compile-time restriction" ,
180
- }
181
- if reason , ok := skipCases [test .Description ]; ok {
182
- t .Skipf ("skip test case %s: %s" , test .Description , reason )
183
- }
156
+ spectest .CheckSkip (t )
184
157
185
158
t .Parallel ()
186
159
0 commit comments