Skip to content

Commit d77378e

Browse files
authored
test: add tests to achieve 100% code coverage in stats/base/max
PR-URL: #5067 Reviewed-by: Athan Reines <[email protected]>
1 parent e242eb1 commit d77378e

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed

lib/node_modules/@stdlib/stats/base/max/test/test.main.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,18 @@ tape( 'if provided a `stride` parameter equal to `0`, the function returns the f
218218
t.end();
219219
});
220220

221+
tape( 'if provided a `stride` parameter equal to `0`, the function returns the first element (accessors)', function test( t ) {
222+
var x;
223+
var v;
224+
225+
x = [ 1.0, -2.0, -4.0, 5.0, 3.0 ];
226+
227+
v = max( x.length, toAccessorArray( x ), 0 );
228+
t.strictEqual( v, 1.0, 'returns expected value' );
229+
230+
t.end();
231+
});
232+
221233
tape( 'the function supports view offsets', function test( t ) {
222234
var x0;
223235
var x1;

lib/node_modules/@stdlib/stats/base/max/test/test.ndarray.js

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

199+
tape( 'if provided a `stride` parameter equal to `0`, the function returns the first indexed element (accessors)', function test( t ) {
200+
var x;
201+
var v;
202+
203+
x = [ 1.0, -2.0, -4.0, 5.0, 3.0 ];
204+
205+
v = max( x.length, toAccessorArray( x ), 0, 0 );
206+
t.strictEqual( v, 1.0, 'returns expected value' );
207+
208+
t.end();
209+
});
210+
199211
tape( 'the function supports an `offset` parameter', function test( t ) {
200212
var x;
201213
var v;

0 commit comments

Comments
 (0)