Skip to content

Commit 19dd4ec

Browse files
committed
fix: variancepn test files
--- 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 94f8217 commit 19dd4ec

File tree

2 files changed

+15
-41
lines changed

2 files changed

+15
-41
lines changed

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

Lines changed: 7 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/**
22
* @license Apache-2.0
33
*
4-
* Copyright (c) 2025 The Stdlib Authors.
4+
* Copyright (c) 2020 The Stdlib Authors.
55
*
66
* Licensed under the Apache License, Version 2.0 (the "License");
77
* you may not use this file except in compliance with the License.
@@ -21,7 +21,6 @@
2121
// MODULES //
2222

2323
var tape = require( 'tape' );
24-
var floor = require( '@stdlib/math/base/special/floor' );
2524
var isnan = require( '@stdlib/math/base/assert/is-nan' );
2625
var toAccessorArray = require( '@stdlib/array/base/to-accessor-array' );
2726
var variancepn = require( './../lib/ndarray.js' );
@@ -201,7 +200,6 @@ tape( 'if provided a `correction` parameter yielding `N-correction` less than or
201200
});
202201

203202
tape( 'the function supports a `stride` parameter', function test( t ) {
204-
var N;
205203
var x;
206204
var v;
207205

@@ -216,15 +214,13 @@ tape( 'the function supports a `stride` parameter', function test( t ) {
216214
2.0
217215
];
218216

219-
N = floor( x.length / 2 );
220-
v = variancepn( N, 1, x, 2, 0 );
217+
v = variancepn( 4, 1, x, 2, 0 );
221218

222219
t.strictEqual( v, 6.25, 'returns expected value' );
223220
t.end();
224221
});
225222

226223
tape( 'the function supports a `stride` parameter (accessor)', function test( t ) {
227-
var N;
228224
var x;
229225
var v;
230226

@@ -239,15 +235,13 @@ tape( 'the function supports a `stride` parameter (accessor)', function test( t
239235
2.0
240236
];
241237

242-
N = floor( x.length / 2 );
243-
v = variancepn( N, 1, toAccessorArray( x ), 2, 0 );
238+
v = variancepn( 4, 1, toAccessorArray( x ), 2, 0 );
244239

245240
t.strictEqual( v, 6.25, 'returns expected value' );
246241
t.end();
247242
});
248243

249244
tape( 'the function supports a negative `stride` parameter', function test( t ) {
250-
var N;
251245
var x;
252246
var v;
253247

@@ -262,15 +256,13 @@ tape( 'the function supports a negative `stride` parameter', function test( t )
262256
2.0
263257
];
264258

265-
N = floor( x.length / 2 );
266-
v = variancepn( N, 1, x, -2, 6 );
259+
v = variancepn( 4, 1, x, -2, 6 );
267260

268261
t.strictEqual( v, 6.25, 'returns expected value' );
269262
t.end();
270263
});
271264

272265
tape( 'the function supports a negative `stride` parameter (accessor)', function test( t ) {
273-
var N;
274266
var x;
275267
var v;
276268

@@ -285,8 +277,7 @@ tape( 'the function supports a negative `stride` parameter (accessor)', function
285277
2.0
286278
];
287279

288-
N = floor( x.length / 2 );
289-
v = variancepn( N, 1, toAccessorArray( x ), -2, 6 );
280+
v = variancepn( 4, 1, toAccessorArray( x ), -2, 6 );
290281

291282
t.strictEqual( v, 6.25, 'returns expected value' );
292283
t.end();
@@ -317,7 +308,6 @@ tape( 'if provided a `stride` parameter equal to `0`, the function returns `0` (
317308
});
318309

319310
tape( 'the function supports an `offset` parameter', function test( t ) {
320-
var N;
321311
var x;
322312
var v;
323313

@@ -331,16 +321,14 @@ tape( 'the function supports an `offset` parameter', function test( t ) {
331321
3.0,
332322
4.0 // 3
333323
];
334-
N = floor( x.length / 2 );
335324

336-
v = variancepn( N, 1, x, 2, 1 );
325+
v = variancepn( 4, 1, x, 2, 1 );
337326
t.strictEqual( v, 6.25, 'returns expected value' );
338327

339328
t.end();
340329
});
341330

342331
tape( 'the function supports an `offset` parameter (accessor)', function test( t ) {
343-
var N;
344332
var x;
345333
var v;
346334

@@ -354,9 +342,8 @@ tape( 'the function supports an `offset` parameter (accessor)', function test( t
354342
3.0,
355343
4.0 // 3
356344
];
357-
N = floor( x.length / 2 );
358345

359-
v = variancepn( N, 1, toAccessorArray( x ), 2, 1 );
346+
v = variancepn( 4, 1, toAccessorArray( x ), 2, 1 );
360347
t.strictEqual( v, 6.25, 'returns expected value' );
361348

362349
t.end();

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

Lines changed: 8 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/**
22
* @license Apache-2.0
33
*
4-
* Copyright (c) 2025 The Stdlib Authors.
4+
* Copyright (c) 2020 The Stdlib Authors.
55
*
66
* Licensed under the Apache License, Version 2.0 (the "License");
77
* you may not use this file except in compliance with the License.
@@ -21,11 +21,10 @@
2121
// MODULES //
2222

2323
var tape = require( 'tape' );
24-
var floor = require( '@stdlib/math/base/special/floor' );
2524
var isnan = require( '@stdlib/math/base/assert/is-nan' );
2625
var Float64Array = require( '@stdlib/array/float64' );
2726
var toAccessorArray = require( '@stdlib/array/base/to-accessor-array' );
28-
var variancepn = require( './../lib/variancepn.js' );
27+
var variancepn = require( './../lib/main.js' );
2928

3029

3130
// TESTS //
@@ -202,7 +201,6 @@ tape( 'if provided a `correction` parameter yielding `N-correction` less than or
202201
});
203202

204203
tape( 'the function supports a `stride` parameter', function test( t ) {
205-
var N;
206204
var x;
207205
var v;
208206

@@ -217,15 +215,13 @@ tape( 'the function supports a `stride` parameter', function test( t ) {
217215
2.0
218216
];
219217

220-
N = floor( x.length / 2 );
221-
v = variancepn( N, 1, x, 2 );
218+
v = variancepn( 4, 1, x, 2 );
222219

223220
t.strictEqual( v, 6.25, 'returns expected value' );
224221
t.end();
225222
});
226223

227224
tape( 'the function supports a `stride` parameter (accessor)', function test( t ) {
228-
var N;
229225
var x;
230226
var v;
231227

@@ -240,15 +236,13 @@ tape( 'the function supports a `stride` parameter (accessor)', function test( t
240236
2.0
241237
];
242238

243-
N = floor( x.length / 2 );
244-
v = variancepn( N, 1, toAccessorArray( x ), 2 );
239+
v = variancepn( 4, 1, toAccessorArray( x ), 2 );
245240

246241
t.strictEqual( v, 6.25, 'returns expected value' );
247242
t.end();
248243
});
249244

250245
tape( 'the function supports a negative `stride` parameter', function test( t ) {
251-
var N;
252246
var x;
253247
var v;
254248

@@ -263,15 +257,13 @@ tape( 'the function supports a negative `stride` parameter', function test( t )
263257
2.0
264258
];
265259

266-
N = floor( x.length / 2 );
267-
v = variancepn( N, 1, x, -2 );
260+
v = variancepn( 4, 1, x, -2 );
268261

269262
t.strictEqual( v, 6.25, 'returns expected value' );
270263
t.end();
271264
});
272265

273266
tape( 'the function supports a negative `stride` parameter (accessor)', function test( t ) {
274-
var N;
275267
var x;
276268
var v;
277269

@@ -286,8 +278,7 @@ tape( 'the function supports a negative `stride` parameter (accessor)', function
286278
2.0
287279
];
288280

289-
N = floor( x.length / 2 );
290-
v = variancepn( N, 1, toAccessorArray( x ), -2 );
281+
v = variancepn( 4, 1, toAccessorArray( x ), -2 );
291282

292283
t.strictEqual( v, 6.25, 'returns expected value' );
293284
t.end();
@@ -320,7 +311,6 @@ tape( 'if provided a `stride` parameter equal to `0`, the function returns `0` (
320311
tape( 'the function supports view offsets', function test( t ) {
321312
var x0;
322313
var x1;
323-
var N;
324314
var v;
325315

326316
x0 = new Float64Array([
@@ -336,9 +326,8 @@ tape( 'the function supports view offsets', function test( t ) {
336326
]);
337327

338328
x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element
339-
N = floor(x1.length / 2);
340329

341-
v = variancepn( N, 1, x1, 2 );
330+
v = variancepn( 4, 1, x1, 2 );
342331
t.strictEqual( v, 6.25, 'returns expected value' );
343332

344333
t.end();
@@ -347,7 +336,6 @@ tape( 'the function supports view offsets', function test( t ) {
347336
tape( 'the function supports view offsets (accessor)', function test( t ) {
348337
var x0;
349338
var x1;
350-
var N;
351339
var v;
352340

353341
x0 = new Float64Array([
@@ -363,9 +351,8 @@ tape( 'the function supports view offsets (accessor)', function test( t ) {
363351
]);
364352

365353
x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element
366-
N = floor(x1.length / 2);
367354

368-
v = variancepn( N, 1, toAccessorArray( x1 ), 2 );
355+
v = variancepn( 4, 1, toAccessorArray( x1 ), 2 );
369356
t.strictEqual( v, 6.25, 'returns expected value' );
370357

371358
t.end();

0 commit comments

Comments
 (0)