Skip to content

Commit b3d7129

Browse files
committed
fix: add missing 10d tests
--- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: na - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: na - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: passed - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: na - task: lint_typescript_tests status: na - task: lint_license_headers status: passed ---
1 parent e1fb9c9 commit b3d7129

File tree

1 file changed

+145
-0
lines changed
  • lib/node_modules/@stdlib/ndarray/base/includes/test

1 file changed

+145
-0
lines changed

lib/node_modules/@stdlib/ndarray/base/includes/test/test.10d.js

Lines changed: 145 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1088,6 +1088,104 @@ tape( 'the function tests whether a 10-dimensional ndarray contains a specified
10881088
t.end();
10891089
});
10901090

1091+
tape( 'the function tests whether a 10-dimensional ndarray contains a specified value (row-major, non-contiguous, large arrays, complex)', function test( t ) {
1092+
var actual;
1093+
var bsize;
1094+
var xbuf;
1095+
var ord;
1096+
var sh;
1097+
var st;
1098+
var dt;
1099+
var o;
1100+
var x;
1101+
var v;
1102+
1103+
dt = 'complex128';
1104+
ord = 'row-major';
1105+
1106+
bsize = blockSize( dt );
1107+
sh = [ 1, 2, 1, 2, 1, 1, 1, 1, bsize*2, 1 ];
1108+
st = [
1109+
-bsize*16,
1110+
-bsize*8,
1111+
-bsize*8,
1112+
bsize*4,
1113+
bsize*4,
1114+
bsize*4,
1115+
bsize*4,
1116+
bsize*4,
1117+
2,
1118+
2
1119+
];
1120+
o = strides2offset( sh, st );
1121+
xbuf = oneTo( numel( sh )*4, 'float64' );
1122+
1123+
x = ndarray( dt, new Complex128Array( xbuf ), sh, st, o, ord );
1124+
1125+
v = scalar2ndarray( new Complex128( 3.0, 4.0 ), {
1126+
'dtype': 'complex128'
1127+
});
1128+
actual = includes( [ x, v ] );
1129+
t.strictEqual( actual, false, 'returns expected value' );
1130+
1131+
v = scalar2ndarray( new Complex128( 5.0, 6.0 ), {
1132+
'dtype': 'complex128'
1133+
});
1134+
actual = includes( [ x, v ] );
1135+
t.strictEqual( actual, true, 'returns expected value' );
1136+
1137+
t.end();
1138+
});
1139+
1140+
tape( 'the function tests whether a 10-dimensional ndarray contains a specified value (row-major, non-contiguous, large arrays, complex)', function test( t ) {
1141+
var actual;
1142+
var bsize;
1143+
var xbuf;
1144+
var ord;
1145+
var sh;
1146+
var st;
1147+
var dt;
1148+
var o;
1149+
var x;
1150+
var v;
1151+
1152+
dt = 'complex128';
1153+
ord = 'row-major';
1154+
1155+
bsize = blockSize( dt );
1156+
sh = [ 1, 2, 1, 2, 1, 1, 1, 1, 1, bsize*2 ];
1157+
st = [
1158+
-bsize*16,
1159+
-bsize*8,
1160+
-bsize*8,
1161+
bsize*4,
1162+
bsize*4,
1163+
bsize*4,
1164+
bsize*4,
1165+
bsize*4,
1166+
bsize*4,
1167+
2
1168+
];
1169+
o = strides2offset( sh, st );
1170+
xbuf = oneTo( numel( sh )*4, 'float64' );
1171+
1172+
x = ndarray( dt, new Complex128Array( xbuf ), sh, st, o, ord );
1173+
1174+
v = scalar2ndarray( new Complex128( 3.0, 4.0 ), {
1175+
'dtype': 'complex128'
1176+
});
1177+
actual = includes( [ x, v ] );
1178+
t.strictEqual( actual, false, 'returns expected value' );
1179+
1180+
v = scalar2ndarray( new Complex128( 5.0, 6.0 ), {
1181+
'dtype': 'complex128'
1182+
});
1183+
actual = includes( [ x, v ] );
1184+
t.strictEqual( actual, true, 'returns expected value' );
1185+
1186+
t.end();
1187+
});
1188+
10911189
tape( 'the function tests whether a 10-dimensional ndarray contains a specified value (row-major, contiguous, accessors)', function test( t ) {
10921190
var actual;
10931191
var ord;
@@ -2074,6 +2172,53 @@ tape( 'the function tests whether a 10-dimensional ndarray contains a specified
20742172
t.end();
20752173
});
20762174

2175+
tape( 'the function tests whether a 10-dimensional ndarray contains a specified value (column-major, non-contiguous, large arrays)', function test( t ) {
2176+
var actual;
2177+
var bsize;
2178+
var ord;
2179+
var sh;
2180+
var st;
2181+
var dt;
2182+
var o;
2183+
var x;
2184+
var v;
2185+
2186+
dt = 'float64';
2187+
ord = 'column-major';
2188+
2189+
bsize = blockSize( dt );
2190+
sh = [ 1, 1, bsize*2, 1, 1, 1, 2, 1, 2, 1 ];
2191+
st = [
2192+
2,
2193+
2,
2194+
2,
2195+
bsize*4,
2196+
bsize*4,
2197+
-bsize*4,
2198+
bsize*4,
2199+
-bsize*8,
2200+
bsize*8,
2201+
bsize*16
2202+
];
2203+
o = strides2offset( sh, st );
2204+
2205+
x = ndarray( dt, oneTo( numel( sh )*4, dt ), sh, st, o, ord );
2206+
2207+
v = scalar2ndarray( 8.0, {
2208+
'dtype': 'float64'
2209+
});
2210+
actual = includes( [ x, v ] );
2211+
t.strictEqual( actual, false, 'returns expected value' );
2212+
2213+
v = scalar2ndarray( 3.0, {
2214+
'dtype': 'float64'
2215+
});
2216+
actual = includes( [ x, v ] );
2217+
t.strictEqual( actual, true, 'returns expected value' );
2218+
2219+
t.end();
2220+
});
2221+
20772222
tape( 'the function tests whether a 10-dimensional ndarray contains a specified value (column-major, non-contiguous, large arrays)', function test( t ) {
20782223
var actual;
20792224
var bsize;

0 commit comments

Comments
 (0)