Skip to content

Commit 91d9983

Browse files
test: full code coverage for blas/ext/base/dnanasumors
1 parent b8259d3 commit 91d9983

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

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

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,18 @@ tape( 'the function calculates the sum of absolute values (ignoring NaN values)'
7777
t.end();
7878
});
7979

80+
tape( 'if provided a `stride` and `offset` parameter equal to `0` and the first element is NaN, the function returns `0`', function test( t ) {
81+
var x;
82+
var v;
83+
84+
x = new Float64Array( [ NaN, -2.0, -4.0, 5.0, 3.0 ] );
85+
86+
v = dnanasumors( x.length, x, 0, 0 );
87+
t.strictEqual( v, 0.0, 'returns expected value' );
88+
89+
t.end();
90+
});
91+
8092
tape( 'if provided an `N` parameter less than or equal to `0`, the function returns `0.0`', function test( t ) {
8193
var x;
8294
var v;

0 commit comments

Comments
 (0)