Skip to content

Commit 9a71c5d

Browse files
committed
test: add tests to achive 100% code coverage in stats/base/max
--- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: na - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: na - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: passed - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: na - task: lint_typescript_tests status: na - task: lint_license_headers status: passed ---
1 parent ae4d64e commit 9a71c5d

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)