Skip to content

Commit 09ed5c5

Browse files
committed
test: add missing tests
1 parent 37e85cf commit 09ed5c5

File tree

4 files changed

+37
-1
lines changed

4 files changed

+37
-1
lines changed

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

Lines changed: 12 additions & 0 deletions
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 = dnansumors( 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/dnansumors/test/test.dnansumors.native.js

Lines changed: 12 additions & 0 deletions
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`', 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 = dnansumors( 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/dnansumors/test/test.ndarray.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ tape( 'if provided a `stride` parameter equal to `0`, the function returns the s
166166
t.end();
167167
});
168168

169-
tape( 'if provided a `stride` and `offset` parameter equal to `0` and the first element is NaN, the function returns `0`', function test( t ) {
169+
tape( 'if provided a `stride` parameter equal to `0` and the first element is NaN, the function returns `0`', function test( t ) {
170170
var x;
171171
var v;
172172

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

Lines changed: 12 additions & 0 deletions
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`', 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 = dnansumors( 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)