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
-[`5149a6b`](https://github.com/stdlib-js/stdlib/commit/5149a6b650b60568bd0df248c2a97a3d8ca2ca87) - **chore:** minor clean-up _(by Philipp Burckhardt)_
708
710
-[`1aff763`](https://github.com/stdlib-js/stdlib/commit/1aff763c61863b7d737a699db89729d2bba0e1bc) - **feat:** add `ndarray/spread-dimensions`[(#9424)](https://github.com/stdlib-js/stdlib/pull/9424)_(by Muhammad Haris, Athan Reines)_
@@ -542,43 +542,150 @@ tape( 'the function throws an error if provided an options argument which is not
542
542
}
543
543
});
544
544
545
-
tape('the function finds the last elements which pass a test implemented by a predicate function along one or more ndarray dimensions (row-major)',functiontest(t){
546
-
varexpected;
547
-
varactual;
545
+
tape('the function throws an error if provided an options argument with an invalid `dims` property',functiontest(t){
tape('the function throws an error if provided an options argument with a `dims` property which contains duplicate dimensions',functiontest(t){
618
+
varvalues;
619
+
varout;
620
+
varx;
621
+
vari;
622
+
623
+
x=empty([2,2],{
624
+
'dtype': 'float64'
625
+
});
626
+
out=empty([],{
627
+
'dtype': 'float64'
628
+
});
629
+
values=[
630
+
[0,0],
631
+
[1,1]
632
+
];
633
+
634
+
for(i=0;i<values.length;i++){
635
+
t.throws(badValue(values[i]),Error,'throws an error when provided '+values[i]);
636
+
}
572
637
t.end();
638
+
639
+
functionbadValue(value){
640
+
returnfunctionbadValue(){
641
+
varopts={
642
+
'dims': value
643
+
};
644
+
assign(x,out,opts,clbk);
645
+
};
646
+
}
573
647
});
574
648
575
-
tape('the function finds the last elements which pass a test implemented by a predicate function along one or more ndarray dimensions (column-major)',functiontest(t){
649
+
tape('the function throws an error if provided an options argument with a `dims` property which contains more dimensions than are present in the input ndarray',functiontest(t){
650
+
varvalues;
651
+
varout;
652
+
varx;
653
+
vari;
654
+
655
+
x=empty([2,2],{
656
+
'dtype': 'float64'
657
+
});
658
+
out=empty([],{
659
+
'dtype': 'float64'
660
+
});
661
+
values=[
662
+
[0,1,2],
663
+
[0,1,2,3],
664
+
[0,1,2,3,4]
665
+
];
666
+
667
+
for(i=0;i<values.length;i++){
668
+
t.throws(badValue(values[i]),RangeError,'throws an error when provided '+values[i]);
669
+
}
670
+
t.end();
671
+
672
+
functionbadValue(value){
673
+
returnfunctionbadValue(){
674
+
varopts={
675
+
'dims': value
676
+
};
677
+
assign(x,out,opts,clbk);
678
+
};
679
+
}
680
+
});
681
+
682
+
tape('the function finds the last elements which pass a test implemented by a predicate function along one or more ndarray dimensions (row-major)',functiontest(t){
tape('the function finds the last elements which pass a test implemented by a predicate function along one or more ndarray dimensions (column-major)',functiontest(t){
0 commit comments