Skip to content

Commit e66c345

Browse files
test: full code coverage for blas/ext/base/dnanasumors
1 parent 4db1851 commit e66c345

File tree

4 files changed

+37
-1
lines changed

4 files changed

+37
-1
lines changed

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

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,18 @@ tape( 'if provided an `N` parameter less than or equal to `0`, the function retu
9292
t.end();
9393
});
9494

95+
tape( 'if provided a `stride` parameter equal to `0` and the first element is NaN, the function returns 0', function test( t ) {
96+
var x;
97+
var v;
98+
99+
x = new Float64Array( [ NaN, -2.0, -4.0, 5.0, 3.0 ] );
100+
101+
v = dnanasumors( x.length, x, 0, 0 );
102+
t.strictEqual( v, 0.0, 'returns expected value' );
103+
104+
t.end();
105+
});
106+
95107
tape( 'if provided an `N` parameter equal to `1`, the function returns the first element', function test( t ) {
96108
var x;
97109
var v;

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

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,18 @@ tape( 'the function has an arity of 3', opts, function test( t ) {
4747
t.end();
4848
});
4949

50+
tape( 'if provided a `stride` parameter equal to `0` and the first element is NaN, the function returns 0', opts, function test( t ) {
51+
var x;
52+
var v;
53+
54+
x = new Float64Array( [ NaN, -2.0, -4.0, 5.0, 3.0 ] );
55+
56+
v = dnanasumors( x.length, x, 0, 0 );
57+
t.strictEqual( v, 0.0, 'returns expected value' );
58+
59+
t.end();
60+
});
61+
5062
tape( 'the functions throws an error if provided a first argument which is not a number', opts, function test( t ) {
5163
var values;
5264
var i;

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ 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 ) {
80+
tape( 'if provided a `stride` parameter equal to `0` and the first element is NaN, the function returns 0', function test( t ) {
8181
var x;
8282
var v;
8383

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

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,18 @@ tape( 'if provided an `N` parameter equal to `1`, the function returns the first
113113
t.end();
114114
});
115115

116+
tape( 'if provided a `stride` parameter equal to `0` and the first element is NaN, the function returns 0', opts, function test( t ) {
117+
var x;
118+
var v;
119+
120+
x = new Float64Array( [ NaN, -2.0, -4.0, 5.0, 3.0 ] );
121+
122+
v = dnanasumors( x.length, x, 0, 0 );
123+
t.strictEqual( v, 0.0, 'returns expected value' );
124+
125+
t.end();
126+
});
127+
116128
tape( 'the function supports a `stride` parameter', opts, function test( t ) {
117129
var x;
118130
var v;

0 commit comments

Comments
 (0)