Skip to content

Commit ea5a2b7

Browse files
committed
test: add missing test cases
1 parent ae9fb37 commit ea5a2b7

File tree

4 files changed

+48
-0
lines changed

4 files changed

+48
-0
lines changed

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

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,18 @@ tape( 'if provided a `stride` parameter equal to `0`, the function returns the s
194194
t.end();
195195
});
196196

197+
tape( 'if provided a `stride` parameter equal to `0` and the first element is NaN, the function returns 0', function test( t ) {
198+
var x;
199+
var v;
200+
201+
x = new Float64Array( [ NaN, -2.0, -4.0, 5.0, 3.0 ] );
202+
203+
v = dnansumpw( x.length, x, 0 );
204+
t.strictEqual( v, 0.0, 'returns expected value' );
205+
206+
t.end();
207+
});
208+
197209
tape( 'the function supports view offsets', function test( t ) {
198210
var x0;
199211
var x1;

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

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -285,6 +285,18 @@ tape( 'if provided a `stride` parameter equal to `0`, the function returns the s
285285
t.end();
286286
});
287287

288+
tape( 'if provided a `stride` parameter equal to `0` and the first element is NaN, the function returns 0', opts, function test( t ) {
289+
var x;
290+
var v;
291+
292+
x = new Float64Array( [ NaN, -2.0, -4.0, 5.0, 3.0 ] );
293+
294+
v = dnansumpw( x.length, x, 0 );
295+
t.strictEqual( v, 0.0, 'returns expected value' );
296+
297+
t.end();
298+
});
299+
288300
tape( 'the function supports view offsets', opts, function test( t ) {
289301
var x0;
290302
var x1;

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

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,18 @@ tape( 'if provided a `stride` parameter equal to `0`, the function returns the s
194194
t.end();
195195
});
196196

197+
tape( 'if provided a `stride` parameter equal to `0` and the first element is NaN, the function returns 0', function test( t ) {
198+
var x;
199+
var v;
200+
201+
x = new Float64Array( [ NaN, -2.0, -4.0, 5.0, 3.0 ] );
202+
203+
v = dnansumpw( x.length, x, 0, 0 );
204+
t.strictEqual( v, 0.0, 'returns expected value' );
205+
206+
t.end();
207+
});
208+
197209
tape( 'the function supports an `offset` parameter', function test( t ) {
198210
var N;
199211
var x;

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

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,18 @@ tape( 'if provided a `stride` parameter equal to `0`, the function returns the s
203203
t.end();
204204
});
205205

206+
tape( 'if provided a `stride` parameter equal to `0` and the first element is NaN, the function returns 0', opts, function test( t ) {
207+
var x;
208+
var v;
209+
210+
x = new Float64Array( [ NaN, -2.0, -4.0, 5.0, 3.0 ] );
211+
212+
v = dnansumpw( x.length, x, 0, 0 );
213+
t.strictEqual( v, 0.0, 'returns expected value' );
214+
215+
t.end();
216+
});
217+
206218
tape( 'the function supports an `offset` parameter', opts, function test( t ) {
207219
var N;
208220
var x;

0 commit comments

Comments
 (0)