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_no_codegen.js
+92-4Lines changed: 92 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -375,8 +375,8 @@ tape( 'an ndarray constructor returns an instance which has a `set` method for s
375
375
'codegen': false
376
376
};
377
377
378
-
dtype='float64';
379
-
buffer=newFloat64Array([1.0,2.0,3.0,4.0]);
378
+
dtype='generic';
379
+
buffer=[1.0,2.0,3.0,4.0];
380
380
shape=[4];
381
381
order='row-major';
382
382
strides=[1];
@@ -419,8 +419,8 @@ tape( 'an ndarray constructor returns an instance which has a `set` method for s
419
419
'codegen': false
420
420
};
421
421
422
-
dtype='float64';
423
-
buffer=newFloat64Array([1.0,2.0,3.0,4.0]);
422
+
dtype='generic';
423
+
buffer=[1.0,2.0,3.0,4.0];
424
424
shape=[4];
425
425
order='column-major';
426
426
strides=[1];
@@ -799,3 +799,91 @@ tape( 'an ndarray constructor returns an instance which has a `set` method for s
799
799
800
800
t.end();
801
801
});
802
+
803
+
tape('an ndarray constructor returns an instance which has a `set` method for setting an array element using subscripts (3d; row-major; codegen=false)',functiontest(t){
804
+
varstrides;
805
+
varbuffer;
806
+
varoffset;
807
+
vardtype;
808
+
varorder;
809
+
varshape;
810
+
varopts;
811
+
vararr;
812
+
varf;
813
+
814
+
opts={
815
+
'codegen': false
816
+
};
817
+
818
+
dtype='generic';
819
+
buffer=[1.0,2.0,3.0,4.0];
820
+
shape=[1,2,2];
821
+
order='row-major';
822
+
strides=[4,2,1];
823
+
offset=0;
824
+
825
+
f=ctor(dtype,shape.length,opts);
826
+
arr=f(buffer,shape,strides,offset,order);
827
+
828
+
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; codegen=false)',functiontest(t){
848
+
varstrides;
849
+
varbuffer;
850
+
varoffset;
851
+
vardtype;
852
+
varorder;
853
+
varshape;
854
+
varopts;
855
+
vararr;
856
+
varf;
857
+
858
+
opts={
859
+
'codegen': false
860
+
};
861
+
862
+
dtype='generic';
863
+
buffer=[1.0,2.0,3.0,4.0];
864
+
shape=[1,2,2];
865
+
order='column-major';
866
+
strides=[1,1,2];
867
+
offset=0;
868
+
869
+
f=ctor(dtype,shape.length,opts);
870
+
arr=f(buffer,shape,strides,offset,order);
871
+
872
+
t.strictEqual(hasOwnProp(arr,'set'),false,'does not have own property');
0 commit comments