Skip to content

Commit 9b21c25

Browse files
test: acheving 100% test coverage
1 parent 22b1ac8 commit 9b21c25

File tree

4 files changed

+43
-0
lines changed

4 files changed

+43
-0
lines changed

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

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,17 @@ tape( 'the function has an arity of 3', function test( t ) {
3838
t.end();
3939
});
4040

41+
tape( 'if provided a `stride` parameter equal to `0` and the first element is NaN, the function returns 0', opts, function test( t ) {
42+
var x;
43+
var v;
44+
45+
x = new Float64Array( [ NaN, 1.0, 2.0, 3.0, 4.0 ] );
46+
47+
v = dnansumkbn( x.length, x, 0 );
48+
t.strictEqual( v, 0.0, 'returns expected Value' );
49+
t.end();
50+
});
51+
4152
tape( 'the function calculates the sum of strided array elements (ignoring NaN values)', function test( t ) {
4253
var x;
4354
var v;

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

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,16 @@ 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, 1.0, 2.0, 3.0, 4.0 ] );
55+
56+
v = dnansumkbn( x.length, x, 0 );
57+
t.strictEqual( v, 0.0, 'returns expected Value' );
58+
t.end();
59+
});
5060
tape( 'the functions throws an error if provided a first argument which is not a number', opts, function test( t ) {
5161
var values;
5262
var i;

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

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,17 @@ tape( 'the function has an arity of 4', function test( t ) {
3838
t.end();
3939
});
4040

41+
tape( 'if provided a `stride` parameter equal to `0` and the first element is NaN, the function returns 0', opts, function test( t ) {
42+
var x;
43+
var v;
44+
45+
x = new Float64Array( [ NaN, 1.0, 2.0, 3.0, 4.0 ] );
46+
47+
v = dnansumkbn( x.length, x, 0 );
48+
t.strictEqual( v, 0.0, 'returns expected Value' );
49+
t.end();
50+
});
51+
4152
tape( 'the function calculates the sum of strided array elements (ignoring NaN values)', function test( t ) {
4253
var x;
4354
var v;

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

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,17 @@ tape( 'the function has an arity of 4', 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, 1.0, 2.0, 3.0, 4.0 ] );
55+
56+
v = dnansumkbn( x.length, x, 0 );
57+
t.strictEqual( v, 0.0, 'returns expected Value' );
58+
t.end();
59+
});
60+
5061
tape( 'the function calculates the sum of strided array elements (ignoring NaN values)', opts, function test( t ) {
5162
var x;
5263
var v;

0 commit comments

Comments
 (0)