You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: lib/node_modules/@stdlib/iter/strided-by/test/test.js
-155Lines changed: 0 additions & 155 deletions
Original file line number
Diff line number
Diff line change
@@ -29,37 +29,6 @@ var noop = require( '@stdlib/utils/noop' );
29
29
variterStridedBy=require('./../lib');
30
30
31
31
32
-
// FUNCTIONS //
33
-
34
-
functioncreateIterator(arr){
35
-
varlen;
36
-
varit;
37
-
vari;
38
-
39
-
len=arr.length;
40
-
i=-1;
41
-
42
-
it={};
43
-
it.next=next;
44
-
45
-
returnit;
46
-
47
-
functionnext(){
48
-
varout;
49
-
i+=1;
50
-
if(i<len){
51
-
out={};
52
-
out.value=arr[i];
53
-
out.done=(i===len-1);
54
-
returnout;
55
-
}
56
-
return{
57
-
'done': true
58
-
};
59
-
}
60
-
}
61
-
62
-
63
32
// TESTS //
64
33
65
34
tape('main export is a function',functiontest(t){
@@ -417,40 +386,6 @@ tape( 'the function returns an iterator protocol-compliant object having a `next
417
386
}
418
387
});
419
388
420
-
tape('the function returns an iterator protocol-compliant object having a `next` method which throws an error if a provided callback function does not return a positive integer value (value+done)',functiontest(t){
421
-
varvalues;
422
-
vari;
423
-
424
-
values=[
425
-
'5',
426
-
-5,
427
-
0,
428
-
3.14,
429
-
NaN,
430
-
true,
431
-
false,
432
-
null,
433
-
void0,
434
-
[],
435
-
{},
436
-
functionnoop(){}
437
-
];
438
-
for(i=0;i<values.length;i++){
439
-
t.throws(badValue(values[i]),TypeError,'throws an error when a callback returns '+values[i]);
440
-
}
441
-
t.end();
442
-
443
-
functionbadValue(value){
444
-
functionclbk(){
445
-
returnvalue;
446
-
}
447
-
returnfunctionbadValue(){
448
-
varit=iterStridedBy(createIterator([1,2]),clbk);
449
-
it.next();
450
-
};
451
-
}
452
-
});
453
-
454
389
tape('the function returns an iterator protocol-compliant object',functiontest(t){
455
390
varit;
456
391
varr;
@@ -471,48 +406,6 @@ tape( 'the function returns an iterator protocol-compliant object', function tes
471
406
}
472
407
});
473
408
474
-
tape('the function returns an iterator protocol-compliant object (value+done)',functiontest(t){
0 commit comments