@@ -108,15 +108,15 @@ tape( 'the function calculates the cumulative minimum absolute value', function
108
108
t . end ( ) ;
109
109
} ) ;
110
110
111
- tape ( 'the function computes the cumulative minimum absolute value (accessor )' , function test ( t ) {
111
+ tape ( 'the function computes the cumulative minimum absolute value (accessors )' , function test ( t ) {
112
112
var expected ;
113
113
var x ;
114
114
var y ;
115
115
var i ;
116
116
117
117
x = [ 1.0 , - 2.0 , 3.0 , - 4.0 , 5.0 ] ;
118
118
y = [ 0.0 , 0.0 , 0.0 , 0.0 , 0.0 ] ;
119
- cuminabs ( x . length , toAccessorArray ( x ) , 1 , 0 , toAccessorArray ( y ) , 1 , 0 ) ;
119
+ cuminabs ( x . length , toAccessorArray ( x ) , 1 , 0 , toAccessorArray ( y ) , 1 , 0 ) ; // eslint-disable-line max-len
120
120
121
121
expected = [
122
122
1.0 ,
@@ -129,7 +129,7 @@ tape( 'the function computes the cumulative minimum absolute value (accessor)',
129
129
130
130
x = [ - 0.0 , 0.0 , - 0.0 ] ;
131
131
y = [ - 0.0 , - 0.0 , - 0.0 ] ;
132
- cuminabs ( x . length , toAccessorArray ( x ) , 1 , 0 , toAccessorArray ( y ) , 1 , 0 ) ;
132
+ cuminabs ( x . length , toAccessorArray ( x ) , 1 , 0 , toAccessorArray ( y ) , 1 , 0 ) ; // eslint-disable-line max-len
133
133
134
134
expected = [
135
135
0.0 ,
@@ -142,23 +142,23 @@ tape( 'the function computes the cumulative minimum absolute value (accessor)',
142
142
143
143
x = [ NaN ] ;
144
144
y = [ 0.0 ] ;
145
- cuminabs ( x . length , toAccessorArray ( x ) , 1 , 0 , toAccessorArray ( y ) , 1 , 0 ) ;
145
+ cuminabs ( x . length , toAccessorArray ( x ) , 1 , 0 , toAccessorArray ( y ) , 1 , 0 ) ; // eslint-disable-line max-len
146
146
147
147
for ( i = 0 ; i < y . length ; i ++ ) {
148
148
t . strictEqual ( isnan ( y [ i ] ) , true , 'returns expected value. i: ' + i ) ;
149
149
}
150
150
151
151
x = [ NaN , NaN ] ;
152
152
y = [ 0.0 , 0.0 ] ;
153
- cuminabs ( x . length , toAccessorArray ( x ) , 1 , 0 , toAccessorArray ( y ) , 1 , 0 ) ;
153
+ cuminabs ( x . length , toAccessorArray ( x ) , 1 , 0 , toAccessorArray ( y ) , 1 , 0 ) ; // eslint-disable-line max-len
154
154
155
155
for ( i = 0 ; i < y . length ; i ++ ) {
156
156
t . strictEqual ( isnan ( y [ i ] ) , true , 'returns expected value. i: ' + i ) ;
157
157
}
158
158
159
159
x = [ 1.0 , NaN , 3.0 , NaN ] ;
160
160
y = [ 0.0 , 0.0 , 0.0 , 0.0 ] ;
161
- cuminabs ( x . length , toAccessorArray ( x ) , 1 , 0 , toAccessorArray ( y ) , 1 , 0 ) ;
161
+ cuminabs ( x . length , toAccessorArray ( x ) , 1 , 0 , toAccessorArray ( y ) , 1 , 0 ) ; // eslint-disable-line max-len
162
162
163
163
expected = [
164
164
1.0 ,
@@ -190,7 +190,7 @@ tape( 'the function returns a reference to the output array', function test( t )
190
190
t . end ( ) ;
191
191
} ) ;
192
192
193
- tape ( 'the function returns a reference to the output array (accessor )' , function test ( t ) {
193
+ tape ( 'the function returns a reference to the output array (accessors )' , function test ( t ) {
194
194
var out ;
195
195
var x ;
196
196
var y ;
@@ -223,6 +223,25 @@ tape( 'if provided an `N` parameter less than or equal to `0`, the function retu
223
223
t . end ( ) ;
224
224
} ) ;
225
225
226
+ tape ( 'if provided an `N` parameter less than or equal to `0`, the function returns `y` unchanged (accessors)' , function test ( t ) {
227
+ var expected ;
228
+ var x ;
229
+ var y ;
230
+
231
+ x = [ 1.0 , 2.0 , 3.0 , 4.0 , 5.0 ] ;
232
+ y = [ 6.0 , 7.0 , 8.0 , 9.0 , 10.0 ] ;
233
+
234
+ expected = [ 6.0 , 7.0 , 8.0 , 9.0 , 10.0 ] ;
235
+
236
+ cuminabs ( - 1 , toAccessorArray ( x ) , 1 , 0 , toAccessorArray ( y ) , 1 , 0 ) ;
237
+ t . deepEqual ( y , expected , 'returns `y` unchanged' ) ;
238
+
239
+ cuminabs ( 0 , toAccessorArray ( x ) , 1 , 0 , toAccessorArray ( y ) , 1 , 0 ) ;
240
+ t . deepEqual ( y , expected , 'returns `y` unchanged' ) ;
241
+
242
+ t . end ( ) ;
243
+ } ) ;
244
+
226
245
tape ( 'the function supports an `x` stride' , function test ( t ) {
227
246
var expected ;
228
247
var x ;
@@ -253,7 +272,7 @@ tape( 'the function supports an `x` stride', function test( t ) {
253
272
t . end ( ) ;
254
273
} ) ;
255
274
256
- tape ( 'the function supports an `x` stride (accessor )' , function test ( t ) {
275
+ tape ( 'the function supports an `x` stride (accessors )' , function test ( t ) {
257
276
var expected ;
258
277
var x ;
259
278
var y ;
@@ -313,7 +332,7 @@ tape( 'the function supports a `y` stride', function test( t ) {
313
332
t . end ( ) ;
314
333
} ) ;
315
334
316
- tape ( 'the function supports a `y` stride (accessor )' , function test ( t ) {
335
+ tape ( 'the function supports a `y` stride (accessors )' , function test ( t ) {
317
336
var expected ;
318
337
var x ;
319
338
var y ;
@@ -373,7 +392,7 @@ tape( 'the function supports negative strides', function test( t ) {
373
392
t . end ( ) ;
374
393
} ) ;
375
394
376
- tape ( 'the function supports negative strides (accessor )' , function test ( t ) {
395
+ tape ( 'the function supports negative strides (accessors )' , function test ( t ) {
377
396
var expected ;
378
397
var x ;
379
398
var y ;
@@ -395,7 +414,7 @@ tape( 'the function supports negative strides (accessor)', function test( t ) {
395
414
] ;
396
415
N = 3 ;
397
416
398
- cuminabs ( N , toAccessorArray ( x ) , - 2 , x . length - 1 , toAccessorArray ( y ) , - 1 , 2 ) ;
417
+ cuminabs ( N , toAccessorArray ( x ) , - 2 , x . length - 1 , toAccessorArray ( y ) , - 1 , 2 ) ; // eslint-disable-line max-len
399
418
400
419
expected = [ 1.0 , 3.0 , 5.0 , 0.0 , 0.0 ] ;
401
420
t . deepEqual ( y , expected , 'returns expected value' ) ;
@@ -437,7 +456,7 @@ tape( 'the function supports an `x` offset', function test( t ) {
437
456
t . end ( ) ;
438
457
} ) ;
439
458
440
- tape ( 'the function supports an `x` offset (accessor )' , function test ( t ) {
459
+ tape ( 'the function supports an `x` offset (accessors )' , function test ( t ) {
441
460
var expected ;
442
461
var x ;
443
462
var y ;
@@ -505,7 +524,7 @@ tape( 'the function supports a `y` offset', function test( t ) {
505
524
t . end ( ) ;
506
525
} ) ;
507
526
508
- tape ( 'the function supports a `y` offset (accessor )' , function test ( t ) {
527
+ tape ( 'the function supports a `y` offset (accessors )' , function test ( t ) {
509
528
var expected ;
510
529
var x ;
511
530
var y ;
@@ -569,7 +588,7 @@ tape( 'the function supports complex access patterns', function test( t ) {
569
588
t . end ( ) ;
570
589
} ) ;
571
590
572
- tape ( 'the function supports complex access patterns (accessor )' , function test ( t ) {
591
+ tape ( 'the function supports complex access patterns (accessors )' , function test ( t ) {
573
592
var expected ;
574
593
var x ;
575
594
var y ;
0 commit comments