@@ -18,15 +18,11 @@ type VectorTest = {
18
18
type VectorSuite = { description : string ; test_key : string ; tests : VectorTest [ ] } ;
19
19
20
20
function fixFloats ( f : string | number ) : number {
21
+ // Should be nothing to "fix" but validates we didn't get
22
+ // an unexpected type so we don't silently fail on it during the test
21
23
if ( typeof f === 'number' ) {
22
24
return f ;
23
25
}
24
- if ( f === 'inf' ) {
25
- return Infinity ;
26
- }
27
- if ( f === '-inf' ) {
28
- return - Infinity ;
29
- }
30
26
throw new Error ( `test format error: unknown float value: ${ f } ` ) ;
31
27
}
32
28
@@ -98,8 +94,6 @@ const invalidTestExpectedError = new Map()
98
94
. set ( 'Overflow Vector INT8' , false )
99
95
. set ( 'Underflow Vector INT8' , false )
100
96
. set ( 'INT8 with float inputs' , false )
101
- // duplicate test! but also skipped.
102
- . set ( 'Vector with float values PACKED_BIT' , false )
103
97
. set ( 'Vector with float values PACKED_BIT' , false ) ;
104
98
105
99
function testVectorBuilding ( test : VectorTest , expectedErrorMessage : string ) {
@@ -184,7 +178,7 @@ describe('BSON Binary Vector spec tests', () => {
184
178
const tests : Record < string , VectorSuite > = Object . create ( null ) ;
185
179
186
180
for ( const file of fs . readdirSync ( path . join ( __dirname , 'specs/bson-binary-vector' ) ) ) {
187
- tests [ path . basename ( file , '.json' ) ] = JSON . parse (
181
+ tests [ path . basename ( file , '.json' ) ] = EJSON . parse (
188
182
fs . readFileSync ( path . join ( __dirname , 'specs/bson-binary-vector' , file ) , 'utf8' )
189
183
) ;
190
184
}
0 commit comments