Skip to content

Commit 35e5fcc

Browse files
committed
fix: update tests and test descriptions
--- 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 9d89a8b commit 35e5fcc

File tree

2 files changed

+59
-21
lines changed

2 files changed

+59
-21
lines changed

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

Lines changed: 26 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ tape( 'the function computes the cumulative minimum absolute value', function te
109109
t.end();
110110
});
111111

112-
tape( 'the function computes the cumulative minimum absolute value (accessor)', function test( t ) {
112+
tape( 'the function computes the cumulative minimum absolute value (accessors)', function test( t ) {
113113
var expected;
114114
var x;
115115
var y;
@@ -191,7 +191,7 @@ tape( 'the function returns a reference to the output array', function test( t )
191191
t.end();
192192
});
193193

194-
tape( 'the function returns a reference to the output array (accessor)', function test( t ) {
194+
tape( 'the function returns a reference to the output array (accessors)', function test( t ) {
195195
var out;
196196
var x;
197197
var y;
@@ -224,6 +224,25 @@ tape( 'if provided an `N` parameter less than or equal to `0`, the function retu
224224
t.end();
225225
});
226226

227+
tape( 'if provided an `N` parameter less than or equal to `0`, the function returns `y` unchanged (accessors)', function test( t ) {
228+
var expected;
229+
var x;
230+
var y;
231+
232+
x = [ 1.0, 2.0, 3.0, 4.0, 5.0 ];
233+
y = [ 6.0, 7.0, 8.0, 9.0, 10.0 ];
234+
235+
expected = [ 6.0, 7.0, 8.0, 9.0, 10.0 ];
236+
237+
cuminabs( -1, toAccessorArray( x ), 1, toAccessorArray( y ), 1 );
238+
t.deepEqual( y, expected, 'returns `y` unchanged' );
239+
240+
cuminabs( 0, toAccessorArray( x ), 1, toAccessorArray( y ), 1 );
241+
t.deepEqual( y, expected, 'returns `y` unchanged' );
242+
243+
t.end();
244+
});
245+
227246
tape( 'the function supports an `x` stride', function test( t ) {
228247
var expected;
229248
var x;
@@ -254,7 +273,7 @@ tape( 'the function supports an `x` stride', function test( t ) {
254273
t.end();
255274
});
256275

257-
tape( 'the function supports an `x` stride (accessor)', function test( t ) {
276+
tape( 'the function supports an `x` stride (accessors)', function test( t ) {
258277
var expected;
259278
var x;
260279
var y;
@@ -314,7 +333,7 @@ tape( 'the function supports a `y` stride', function test( t ) {
314333
t.end();
315334
});
316335

317-
tape( 'the function supports a `y` stride (accessor)', function test( t ) {
336+
tape( 'the function supports a `y` stride (accessors)', function test( t ) {
318337
var expected;
319338
var x;
320339
var y;
@@ -374,7 +393,7 @@ tape( 'the function supports negative strides', function test( t ) {
374393
t.end();
375394
});
376395

377-
tape( 'the function supports negative strides (accessor)', function test( t ) {
396+
tape( 'the function supports negative strides (accessors)', function test( t ) {
378397
var expected;
379398
var x;
380399
var y;
@@ -436,7 +455,7 @@ tape( 'the function supports complex access patterns', function test( t ) {
436455
t.end();
437456
});
438457

439-
tape( 'the function supports complex access patterns (accessor)', function test( t ) {
458+
tape( 'the function supports complex access patterns (accessors)', function test( t ) {
440459
var expected;
441460
var x;
442461
var y;
@@ -504,7 +523,7 @@ tape( 'the function supports view offsets', function test( t ) {
504523
t.end();
505524
});
506525

507-
tape( 'the function supports view offsets (accessor)', function test( t ) {
526+
tape( 'the function supports view offsets (accessors)', function test( t ) {
508527
var expected;
509528
var x0;
510529
var y0;

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

Lines changed: 33 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -108,15 +108,15 @@ tape( 'the function calculates the cumulative minimum absolute value', function
108108
t.end();
109109
});
110110

111-
tape( 'the function computes the cumulative minimum absolute value (accessor)', function test( t ) {
111+
tape( 'the function computes the cumulative minimum absolute value (accessors)', function test( t ) {
112112
var expected;
113113
var x;
114114
var y;
115115
var i;
116116

117117
x = [ 1.0, -2.0, 3.0, -4.0, 5.0 ];
118118
y = [ 0.0, 0.0, 0.0, 0.0, 0.0 ];
119-
cuminabs( x.length, toAccessorArray( x ), 1, 0, toAccessorArray( y ), 1, 0 );
119+
cuminabs( x.length, toAccessorArray( x ), 1, 0, toAccessorArray( y ), 1, 0 ); // eslint-disable-line max-len
120120

121121
expected = [
122122
1.0,
@@ -129,7 +129,7 @@ tape( 'the function computes the cumulative minimum absolute value (accessor)',
129129

130130
x = [ -0.0, 0.0, -0.0 ];
131131
y = [ -0.0, -0.0, -0.0 ];
132-
cuminabs( x.length, toAccessorArray( x ), 1, 0, toAccessorArray( y ), 1, 0 );
132+
cuminabs( x.length, toAccessorArray( x ), 1, 0, toAccessorArray( y ), 1, 0 ); // eslint-disable-line max-len
133133

134134
expected = [
135135
0.0,
@@ -142,23 +142,23 @@ tape( 'the function computes the cumulative minimum absolute value (accessor)',
142142

143143
x = [ NaN ];
144144
y = [ 0.0 ];
145-
cuminabs( x.length, toAccessorArray( x ), 1, 0, toAccessorArray( y ), 1, 0 );
145+
cuminabs( x.length, toAccessorArray( x ), 1, 0, toAccessorArray( y ), 1, 0 ); // eslint-disable-line max-len
146146

147147
for ( i = 0; i < y.length; i++ ) {
148148
t.strictEqual( isnan( y[ i ] ), true, 'returns expected value. i: ' + i );
149149
}
150150

151151
x = [ NaN, NaN ];
152152
y = [ 0.0, 0.0 ];
153-
cuminabs( x.length, toAccessorArray( x ), 1, 0, toAccessorArray( y ), 1, 0 );
153+
cuminabs( x.length, toAccessorArray( x ), 1, 0, toAccessorArray( y ), 1, 0 ); // eslint-disable-line max-len
154154

155155
for ( i = 0; i < y.length; i++ ) {
156156
t.strictEqual( isnan( y[ i ] ), true, 'returns expected value. i: ' + i );
157157
}
158158

159159
x = [ 1.0, NaN, 3.0, NaN ];
160160
y = [ 0.0, 0.0, 0.0, 0.0 ];
161-
cuminabs( x.length, toAccessorArray( x ), 1, 0, toAccessorArray( y ), 1, 0 );
161+
cuminabs( x.length, toAccessorArray( x ), 1, 0, toAccessorArray( y ), 1, 0 ); // eslint-disable-line max-len
162162

163163
expected = [
164164
1.0,
@@ -190,7 +190,7 @@ tape( 'the function returns a reference to the output array', function test( t )
190190
t.end();
191191
});
192192

193-
tape( 'the function returns a reference to the output array (accessor)', function test( t ) {
193+
tape( 'the function returns a reference to the output array (accessors)', function test( t ) {
194194
var out;
195195
var x;
196196
var y;
@@ -223,6 +223,25 @@ tape( 'if provided an `N` parameter less than or equal to `0`, the function retu
223223
t.end();
224224
});
225225

226+
tape( 'if provided an `N` parameter less than or equal to `0`, the function returns `y` unchanged (accessors)', function test( t ) {
227+
var expected;
228+
var x;
229+
var y;
230+
231+
x = [ 1.0, 2.0, 3.0, 4.0, 5.0 ];
232+
y = [ 6.0, 7.0, 8.0, 9.0, 10.0 ];
233+
234+
expected = [ 6.0, 7.0, 8.0, 9.0, 10.0 ];
235+
236+
cuminabs( -1, toAccessorArray( x ), 1, 0, toAccessorArray( y ), 1, 0 );
237+
t.deepEqual( y, expected, 'returns `y` unchanged' );
238+
239+
cuminabs( 0, toAccessorArray( x ), 1, 0, toAccessorArray( y ), 1, 0 );
240+
t.deepEqual( y, expected, 'returns `y` unchanged' );
241+
242+
t.end();
243+
});
244+
226245
tape( 'the function supports an `x` stride', function test( t ) {
227246
var expected;
228247
var x;
@@ -253,7 +272,7 @@ tape( 'the function supports an `x` stride', function test( t ) {
253272
t.end();
254273
});
255274

256-
tape( 'the function supports an `x` stride (accessor)', function test( t ) {
275+
tape( 'the function supports an `x` stride (accessors)', function test( t ) {
257276
var expected;
258277
var x;
259278
var y;
@@ -313,7 +332,7 @@ tape( 'the function supports a `y` stride', function test( t ) {
313332
t.end();
314333
});
315334

316-
tape( 'the function supports a `y` stride (accessor)', function test( t ) {
335+
tape( 'the function supports a `y` stride (accessors)', function test( t ) {
317336
var expected;
318337
var x;
319338
var y;
@@ -373,7 +392,7 @@ tape( 'the function supports negative strides', function test( t ) {
373392
t.end();
374393
});
375394

376-
tape( 'the function supports negative strides (accessor)', function test( t ) {
395+
tape( 'the function supports negative strides (accessors)', function test( t ) {
377396
var expected;
378397
var x;
379398
var y;
@@ -395,7 +414,7 @@ tape( 'the function supports negative strides (accessor)', function test( t ) {
395414
];
396415
N = 3;
397416

398-
cuminabs( N, toAccessorArray( x ), -2, x.length-1, toAccessorArray( y ), -1, 2 );
417+
cuminabs( N, toAccessorArray( x ), -2, x.length-1, toAccessorArray( y ), -1, 2 ); // eslint-disable-line max-len
399418

400419
expected = [ 1.0, 3.0, 5.0, 0.0, 0.0 ];
401420
t.deepEqual( y, expected, 'returns expected value' );
@@ -437,7 +456,7 @@ tape( 'the function supports an `x` offset', function test( t ) {
437456
t.end();
438457
});
439458

440-
tape( 'the function supports an `x` offset (accessor)', function test( t ) {
459+
tape( 'the function supports an `x` offset (accessors)', function test( t ) {
441460
var expected;
442461
var x;
443462
var y;
@@ -505,7 +524,7 @@ tape( 'the function supports a `y` offset', function test( t ) {
505524
t.end();
506525
});
507526

508-
tape( 'the function supports a `y` offset (accessor)', function test( t ) {
527+
tape( 'the function supports a `y` offset (accessors)', function test( t ) {
509528
var expected;
510529
var x;
511530
var y;
@@ -569,7 +588,7 @@ tape( 'the function supports complex access patterns', function test( t ) {
569588
t.end();
570589
});
571590

572-
tape( 'the function supports complex access patterns (accessor)', function test( t ) {
591+
tape( 'the function supports complex access patterns (accessors)', function test( t ) {
573592
var expected;
574593
var x;
575594
var y;

0 commit comments

Comments
 (0)