@@ -18,15 +18,11 @@ type VectorTest = {
1818type VectorSuite = { description : string ; test_key : string ; tests : VectorTest [ ] } ;
1919
2020function 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
2123 if ( typeof f === 'number' ) {
2224 return f ;
2325 }
24- if ( f === 'inf' ) {
25- return Infinity ;
26- }
27- if ( f === '-inf' ) {
28- return - Infinity ;
29- }
3026 throw new Error ( `test format error: unknown float value: ${ f } ` ) ;
3127}
3228
@@ -98,8 +94,6 @@ const invalidTestExpectedError = new Map()
9894 . set ( 'Overflow Vector INT8' , false )
9995 . set ( 'Underflow Vector INT8' , false )
10096 . set ( 'INT8 with float inputs' , false )
101- // duplicate test! but also skipped.
102- . set ( 'Vector with float values PACKED_BIT' , false )
10397 . set ( 'Vector with float values PACKED_BIT' , false ) ;
10498
10599function testVectorBuilding ( test : VectorTest , expectedErrorMessage : string ) {
@@ -184,7 +178,7 @@ describe('BSON Binary Vector spec tests', () => {
184178 const tests : Record < string , VectorSuite > = Object . create ( null ) ;
185179
186180 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 (
188182 fs . readFileSync ( path . join ( __dirname , 'specs/bson-binary-vector' , file ) , 'utf8' )
189183 ) ;
190184 }
0 commit comments