Skip to content

Commit 4360d42

Browse files
authored
test: add test case
Signed-off-by: Athan <[email protected]>
1 parent 308b1be commit 4360d42

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

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

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

235+
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 ) {
236+
var x;
237+
var v;
238+
239+
x = [ 1.0, -2.0, -4.0, 5.0, 3.0 ];
240+
241+
v = gapxsumpw( x.length, 5.0, toAccessorArray( x ), 0, 0 );
242+
t.strictEqual( v, x.length * (x[0]+5.0), 'returns expected value' );
243+
244+
t.end();
245+
});
246+
235247
tape( 'the function supports an `offset` parameter', function test( t ) {
236248
var x;
237249
var v;

0 commit comments

Comments
 (0)