@@ -15,9 +15,10 @@ import (
1515 "testing"
1616
1717 "go.mongodb.org/mongo-driver/v2/internal/require"
18+ "go.mongodb.org/mongo-driver/v2/internal/spectest"
1819)
1920
20- const bsonBinaryVectorDir = "../testdata/ bson-binary-vector/"
21+ var bsonBinaryVectorDir = spectest . Path ( " bson-binary-vector" )
2122
2223type bsonBinaryVectorTests struct {
2324 Description string `json:"description"`
@@ -128,18 +129,7 @@ func runBsonBinaryVectorTest(t *testing.T, testKey string, test bsonBinaryVector
128129 require .NoError (t , err , "decoding canonical BSON" )
129130
130131 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 )
143133
144134 errMap := map [string ]string {
145135 "FLOAT32 with padding" : "padding must be 0" ,
@@ -163,24 +153,7 @@ func runBsonBinaryVectorTest(t *testing.T, testKey string, test bsonBinaryVector
163153 })
164154
165155 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 )
184157
185158 t .Parallel ()
186159
0 commit comments