Skip to content

Commit

Permalink
test: achieve 100% test coverage for blas/ext/base/dnansumors
Browse files Browse the repository at this point in the history
PR-URL: #3087
Closes: #3075

Co-authored-by: Philipp Burckhardt <[email protected]>
Reviewed-by: Philipp Burckhardt <[email protected]>
Signed-off-by: Philipp Burckhardt <[email protected]>
  • Loading branch information
gururaj1512 and Planeshifter authored Nov 11, 2024
1 parent 6556a46 commit 02735b4
Showing 1 changed file with 16 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,10 @@ tape( 'the function calculates the sum of strided array elements (ignoring NaN v
v = dnansumors( x.length, x, 1, 0 );
t.strictEqual( v, 0.0, 'returns expected value' );

x = new Float64Array( [ NaN, -4.0 ] );
v = dnansumors( x.length, x, 0, 0 );
t.strictEqual( v, 0.0, 'returns expected value' );

t.end();
});

Expand Down Expand Up @@ -162,6 +166,18 @@ tape( 'if provided a `stride` parameter equal to `0`, the function returns the s
t.end();
});

tape( 'if provided a `stride` and `offset` parameter equal to `0` and the first element is NaN, the function returns `0`', function test( t ) {

This comment has been minimized.

Copy link
@kgryte

kgryte Nov 13, 2024

Member

@Planeshifter This test needs to be added to the other test files, as well. Furthermore, the offset parameter does not need to be 0. This should be updated.

This comment has been minimized.

Copy link
@Planeshifter

Planeshifter Dec 1, 2024

Author Member

Done.

var x;
var v;

x = new Float64Array( [ NaN, -2.0, -4.0, 5.0, 3.0 ] );

v = dnansumors( x.length, x, 0, 0 );
t.strictEqual( v, 0.0, 'returns expected value' );

t.end();
});

tape( 'the function supports an `offset` parameter', function test( t ) {
var x;
var v;
Expand Down

1 comment on commit 02735b4

@stdlib-bot
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Coverage Report

Package Statements Branches Functions Lines
blas/ext/base/dnansumors $\color{green}366/366$
$\color{green}+100.00\%$
$\color{green}21/21$
$\color{green}+100.00\%$
$\color{green}4/4$
$\color{green}+100.00\%$
$\color{green}366/366$
$\color{green}+100.00\%$

The above coverage report was generated for the changes in this push.

Please sign in to comment.