@@ -118,13 +118,13 @@ describe(`Table`, () => {
118
118
// Wrap floating point values in a Float32Array and take them back out to
119
119
// make sure that equality checks will pass
120
120
const values = [
121
- [ new Float32Array ( [ - 0.3 ] ) [ 0 ] , - 1 , 'a' ] ,
122
- [ new Float32Array ( [ - 0.2 ] ) [ 0 ] , 1 , 'b' ] ,
123
- [ new Float32Array ( [ - 0.1 ] ) [ 0 ] , - 1 , 'c' ] ,
124
- [ new Float32Array ( [ 0 ] ) [ 0 ] , 1 , 'a' ] ,
125
- [ new Float32Array ( [ 0.1 ] ) [ 0 ] , - 1 , 'b' ] ,
126
- [ new Float32Array ( [ 0.2 ] ) [ 0 ] , 1 , 'c' ] ,
127
- [ new Float32Array ( [ 0.3 ] ) [ 0 ] , - 1 , 'a' ]
121
+ [ Math . fround ( - 0.3 ) , - 1 , 'a' ] ,
122
+ [ Math . fround ( - 0.2 ) , 1 , 'b' ] ,
123
+ [ Math . fround ( - 0.1 ) , - 1 , 'c' ] ,
124
+ [ Math . fround ( 0 ) , 1 , 'a' ] ,
125
+ [ Math . fround ( 0.1 ) , - 1 , 'b' ] ,
126
+ [ Math . fround ( 0.2 ) , 1 , 'c' ] ,
127
+ [ Math . fround ( 0.3 ) , - 1 , 'a' ]
128
128
] ;
129
129
test ( `has the correct length` , ( ) => {
130
130
expect ( table . length ) . toEqual ( values . length ) ;
@@ -161,19 +161,19 @@ describe(`Table`, () => {
161
161
test ( `countBy on dictionary returns the correct counts` , ( ) => {
162
162
// Make sure countBy works both with and without the Col wrapper
163
163
// class
164
- expect ( table . countBy ( col ( 'dictionary' ) ) . asJSON ( ) ) . toEqual ( {
164
+ expect ( table . countBy ( col ( 'dictionary' ) ) . toJSON ( ) ) . toEqual ( {
165
165
'a' : 3 ,
166
166
'b' : 2 ,
167
167
'c' : 2 ,
168
168
} ) ;
169
- expect ( table . countBy ( 'dictionary' ) . asJSON ( ) ) . toEqual ( {
169
+ expect ( table . countBy ( 'dictionary' ) . toJSON ( ) ) . toEqual ( {
170
170
'a' : 3 ,
171
171
'b' : 2 ,
172
172
'c' : 2 ,
173
173
} ) ;
174
174
} ) ;
175
175
test ( `countBy on dictionary with filter returns the correct counts` , ( ) => {
176
- expect ( table . filter ( col ( 'i32' ) . eq ( 1 ) ) . countBy ( 'dictionary' ) . asJSON ( ) ) . toEqual ( {
176
+ expect ( table . filter ( col ( 'i32' ) . eq ( 1 ) ) . countBy ( 'dictionary' ) . toJSON ( ) ) . toEqual ( {
177
177
'a' : 1 ,
178
178
'b' : 1 ,
179
179
'c' : 1 ,
@@ -321,15 +321,15 @@ describe(`Table`, () => {
321
321
// Wrap floating point values in a Float32Array and take them back out to
322
322
// make sure that equality checks will pass
323
323
const values = [
324
- [ new Float32Array ( [ - 0.3 ] ) [ 0 ] , - 1 , 'a' ] ,
325
- [ new Float32Array ( [ - 0.2 ] ) [ 0 ] , 1 , 'b' ] ,
326
- [ new Float32Array ( [ - 0.1 ] ) [ 0 ] , - 1 , 'c' ] ,
327
- [ new Float32Array ( [ 0 ] ) [ 0 ] , 1 , 'a' ] ,
328
- [ new Float32Array ( [ 0.1 ] ) [ 0 ] , - 1 , 'b' ] ,
329
- [ new Float32Array ( [ 0.2 ] ) [ 0 ] , 1 , 'c' ] ,
330
- [ new Float32Array ( [ 0.3 ] ) [ 0 ] , - 1 , 'a' ] ,
331
- [ new Float32Array ( [ 0.2 ] ) [ 0 ] , 1 , 'b' ] ,
332
- [ new Float32Array ( [ 0.1 ] ) [ 0 ] , - 1 , 'c' ] ,
324
+ [ Math . fround ( - 0.3 ) , - 1 , 'a' ] ,
325
+ [ Math . fround ( - 0.2 ) , 1 , 'b' ] ,
326
+ [ Math . fround ( - 0.1 ) , - 1 , 'c' ] ,
327
+ [ Math . fround ( 0 ) , 1 , 'a' ] ,
328
+ [ Math . fround ( 0.1 ) , - 1 , 'b' ] ,
329
+ [ Math . fround ( 0.2 ) , 1 , 'c' ] ,
330
+ [ Math . fround ( 0.3 ) , - 1 , 'a' ] ,
331
+ [ Math . fround ( 0.2 ) , 1 , 'b' ] ,
332
+ [ Math . fround ( 0.1 ) , - 1 , 'c' ] ,
333
333
] ;
334
334
test ( `has the correct length` , ( ) => {
335
335
expect ( table . length ) . toEqual ( values . length ) ;
@@ -366,19 +366,19 @@ describe(`Table`, () => {
366
366
test ( `countBy on dictionary returns the correct counts` , ( ) => {
367
367
// Make sure countBy works both with and without the Col wrapper
368
368
// class
369
- expect ( table . countBy ( col ( 'dictionary' ) ) . asJSON ( ) ) . toEqual ( {
369
+ expect ( table . countBy ( col ( 'dictionary' ) ) . toJSON ( ) ) . toEqual ( {
370
370
'a' : 3 ,
371
371
'b' : 3 ,
372
372
'c' : 3 ,
373
373
} ) ;
374
- expect ( table . countBy ( 'dictionary' ) . asJSON ( ) ) . toEqual ( {
374
+ expect ( table . countBy ( 'dictionary' ) . toJSON ( ) ) . toEqual ( {
375
375
'a' : 3 ,
376
376
'b' : 3 ,
377
377
'c' : 3 ,
378
378
} ) ;
379
379
} ) ;
380
380
test ( `countBy on dictionary with filter returns the correct counts` , ( ) => {
381
- expect ( table . filter ( col ( 'i32' ) . eq ( 1 ) ) . countBy ( col ( 'dictionary' ) ) . asJSON ( ) ) . toEqual ( {
381
+ expect ( table . filter ( col ( 'i32' ) . eq ( 1 ) ) . countBy ( col ( 'dictionary' ) ) . toJSON ( ) ) . toEqual ( {
382
382
'a' : 1 ,
383
383
'b' : 2 ,
384
384
'c' : 1 ,
0 commit comments