Skip to content

Commit b74cfc5

Browse files
committed
test: adds missing test cases
--- 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: passed - task: lint_license_headers status: passed ---
1 parent 0674975 commit b74cfc5

File tree

3 files changed

+26
-0
lines changed

3 files changed

+26
-0
lines changed

lib/node_modules/@stdlib/stats/base/nanmeanpn/docs/types/test.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ import nanmeanpn = require( './index' );
2626
{
2727
const x = new Float64Array( 10 );
2828

29+
nanmeanpn( x.length, x, 1 ); // $ExpectType number
2930
nanmeanpn( x.length, new AccessorArray( x ), 1 ); // $ExpectType number
3031
}
3132

@@ -85,6 +86,7 @@ import nanmeanpn = require( './index' );
8586
{
8687
const x = new Float64Array( 10 );
8788

89+
nanmeanpn.ndarray( x.length, x, 1, 0 ); // $ExpectType number
8890
nanmeanpn.ndarray( x.length, new AccessorArray( x ), 1, 0 ); // $ExpectType number
8991
}
9092

lib/node_modules/@stdlib/stats/base/nanmeanpn/test/test.nanmeanpn.js

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

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

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

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

217+
tape( 'if provided a `stride` parameter equal to `0`, the function returns the first indexed element (accessors)', function test( t ) {
218+
var x;
219+
var v;
220+
221+
x = [ 1.0, -2.0, -4.0, 5.0, 3.0 ];
222+
223+
v = nanmeanpn( x.length, toAccessorArray( x ), 0, 0 );
224+
t.strictEqual( v, 1.0, 'returns expected value' );
225+
226+
t.end();
227+
});
228+
217229
tape( 'the function supports an `offset` parameter', function test( t ) {
218230
var x;
219231
var v;

0 commit comments

Comments
 (0)