Skip to content

Commit 1d610ae

Browse files
authored
test: add test case
Signed-off-by: Athan <[email protected]>
1 parent 5e934c2 commit 1d610ae

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

lib/node_modules/@stdlib/blas/ext/base/gapxsumors/test/test.ndarray.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,18 @@ tape( 'if provided a `stride` parameter equal to `0`, the function returns the f
216216
t.end();
217217
});
218218

219+
tape( 'if provided a `stride` parameter equal to `0`, the function returns the first element plus a constant repeated N times (accessors)', function test( t ) {
220+
var x;
221+
var v;
222+
223+
x = [ 1.0, -2.0, -4.0, 5.0, 3.0 ];
224+
225+
v = gapxsumors( x.length, 5.0, toAccessorArray( x ), 0, 0 );
226+
t.strictEqual( v, x.length * (x[0]+5.0), 'returns expected value' );
227+
228+
t.end();
229+
});
230+
219231
tape( 'the function supports an `offset` parameter', function test( t ) {
220232
var x;
221233
var v;

0 commit comments

Comments
 (0)