Skip to content

Commit cc6362b

Browse files
authored
test: achieve 100% test coverage for blas/ext/base/dnansumkbn
PR-URL: #3051 Closes: #3046 Reviewed-by: Philipp Burckhardt <[email protected]>
1 parent c664da7 commit cc6362b

File tree

4 files changed

+48
-0
lines changed

4 files changed

+48
-0
lines changed

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

+12
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,18 @@ tape( 'if provided a `stride` parameter equal to `0`, the function returns the s
162162
t.end();
163163
});
164164

165+
tape( 'if provided a `stride` parameter equal to `0` and the first element is NaN, the function returns 0', function test( t ) {
166+
var x;
167+
var v;
168+
169+
x = new Float64Array( [ NaN, -2.0, -4.0, 5.0, 3.0 ] );
170+
171+
v = dnansumkbn( x.length, x, 0 );
172+
t.strictEqual( v, 0.0, 'returns expected value' );
173+
174+
t.end();
175+
});
176+
165177
tape( 'the function supports view offsets', function test( t ) {
166178
var x0;
167179
var x1;

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

+12
Original file line numberDiff line numberDiff line change
@@ -253,6 +253,18 @@ tape( 'if provided a `stride` parameter equal to `0`, the function returns the s
253253
t.end();
254254
});
255255

256+
tape( 'if provided a `stride` parameter equal to `0` and the first element is NaN, the function returns 0', opts, function test( t ) {
257+
var x;
258+
var v;
259+
260+
x = new Float64Array( [ NaN, -2.0, -4.0, 5.0, 3.0 ] );
261+
262+
v = dnansumkbn( x.length, x, 0 );
263+
t.strictEqual( v, 0.0, 'returns expected value' );
264+
265+
t.end();
266+
});
267+
256268
tape( 'the function supports view offsets', opts, function test( t ) {
257269
var x0;
258270
var x1;

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

+12
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,18 @@ tape( 'if provided a `stride` parameter equal to `0`, the function returns the s
162162
t.end();
163163
});
164164

165+
tape( 'if provided a `stride` parameter equal to `0` and the first element is NaN, the function returns 0', function test( t ) {
166+
var x;
167+
var v;
168+
169+
x = new Float64Array( [ NaN, -2.0, -4.0, 5.0, 3.0 ] );
170+
171+
v = dnansumkbn( x.length, x, 0, 0 );
172+
t.strictEqual( v, 0.0, 'returns expected value' );
173+
174+
t.end();
175+
});
176+
165177
tape( 'the function supports an `offset` parameter', function test( t ) {
166178
var x;
167179
var v;

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

+12
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,18 @@ tape( 'if provided a `stride` parameter equal to `0`, the function returns the s
171171
t.end();
172172
});
173173

174+
tape( 'if provided a `stride` parameter equal to `0` and the first element is NaN, the function returns 0', opts, function test( t ) {
175+
var x;
176+
var v;
177+
178+
x = new Float64Array( [ NaN, -2.0, -4.0, 5.0, 3.0 ] );
179+
180+
v = dnansumkbn( x.length, x, 0, 0 );
181+
t.strictEqual( v, 0.0, 'returns expected value' );
182+
183+
t.end();
184+
});
185+
174186
tape( 'the function supports an `offset` parameter', opts, function test( t ) {
175187
var x;
176188
var v;

0 commit comments

Comments
 (0)