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/types/ndarray/ctor/test/test.instance.set.js
+82-4Lines changed: 82 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -345,8 +345,8 @@ tape( 'an ndarray constructor returns an instance which has a `set` method for s
345
345
vararr;
346
346
varf;
347
347
348
-
dtype='float64';
349
-
buffer=newFloat64Array([1.0,2.0,3.0,4.0]);
348
+
dtype='generic';
349
+
buffer=[1.0,2.0,3.0,4.0];
350
350
shape=[4];
351
351
order='row-major';
352
352
strides=[1];
@@ -384,8 +384,8 @@ tape( 'an ndarray constructor returns an instance which has a `set` method for s
384
384
vararr;
385
385
varf;
386
386
387
-
dtype='float64';
388
-
buffer=newFloat64Array([1.0,2.0,3.0,4.0]);
387
+
dtype='generic';
388
+
buffer=[1.0,2.0,3.0,4.0];
389
389
shape=[4];
390
390
order='column-major';
391
391
strides=[1];
@@ -724,3 +724,81 @@ tape( 'an ndarray constructor returns an instance which has a `set` method for s
724
724
725
725
t.end();
726
726
});
727
+
728
+
tape('an ndarray constructor returns an instance which has a `set` method for setting an array element using subscripts (3d; row-major)',functiontest(t){
729
+
varstrides;
730
+
varbuffer;
731
+
varoffset;
732
+
vardtype;
733
+
varorder;
734
+
varshape;
735
+
vararr;
736
+
varf;
737
+
738
+
dtype='generic';
739
+
buffer=[1.0,2.0,3.0,4.0];
740
+
shape=[1,2,2];
741
+
order='row-major';
742
+
strides=[4,2,1];
743
+
offset=0;
744
+
745
+
f=ctor(dtype,shape.length);
746
+
arr=f(buffer,shape,strides,offset,order);
747
+
748
+
t.strictEqual(hasOwnProp(arr,'set'),false,'does not have own property');
tape('an ndarray constructor returns an instance which has a `set` method for setting an array element using subscripts (3d; column-major)',functiontest(t){
768
+
varstrides;
769
+
varbuffer;
770
+
varoffset;
771
+
vardtype;
772
+
varorder;
773
+
varshape;
774
+
vararr;
775
+
varf;
776
+
777
+
dtype='generic';
778
+
buffer=[1.0,2.0,3.0,4.0];
779
+
shape=[1,2,2];
780
+
order='column-major';
781
+
strides=[1,1,2];
782
+
offset=0;
783
+
784
+
f=ctor(dtype,shape.length);
785
+
arr=f(buffer,shape,strides,offset,order);
786
+
787
+
t.strictEqual(hasOwnProp(arr,'set'),false,'does not have own property');
0 commit comments