Skip to content

Commit 3c48f50

Browse files
committed
fix: 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: na - task: lint_license_headers status: passed ---
1 parent 6de7b3f commit 3c48f50

File tree

2 files changed

+22
-31
lines changed

2 files changed

+22
-31
lines changed

lib/node_modules/@stdlib/blas/ext/find-index/test/test.assign.js

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ tape( 'the function throws an error if provided a second argument which is not a
220220
}
221221
});
222222

223-
tape( 'the function throws an error if provided a first argument which is not an ndarray-like object (thisArg)', function test( t ) {
223+
tape( 'the function throws an error if provided a second argument which is not an ndarray-like object (thisArg)', function test( t ) {
224224
var values;
225225
var i;
226226
var x;
@@ -253,7 +253,7 @@ tape( 'the function throws an error if provided a first argument which is not an
253253
}
254254
});
255255

256-
tape( 'the function throws an error if provided a first argument which is not an ndarray-like object (options)', function test( t ) {
256+
tape( 'the function throws an error if provided a second argument which is not an ndarray-like object (options)', function test( t ) {
257257
var values;
258258
var i;
259259
var x;
@@ -286,7 +286,7 @@ tape( 'the function throws an error if provided a first argument which is not an
286286
}
287287
});
288288

289-
tape( 'the function throws an error if provided a first argument which is not an ndarray-like object (options, thisArg)', function test( t ) {
289+
tape( 'the function throws an error if provided a second argument which is not an ndarray-like object (options, thisArg)', function test( t ) {
290290
var values;
291291
var i;
292292
var x;
@@ -369,8 +369,7 @@ tape( 'the function throws an error if provided an options argument which is not
369369
false,
370370
null,
371371
void 0,
372-
[],
373-
function noop() {}
372+
[]
374373
];
375374
for ( i = 0; i < values.length; i++ ) {
376375
t.throws( badValue( values[ i ] ), TypeError, 'throws an error when provided ' + values[ i ] );
@@ -405,8 +404,7 @@ tape( 'the function throws an error if provided an options argument which is not
405404
false,
406405
null,
407406
void 0,
408-
[],
409-
function noop() {}
407+
[]
410408
];
411409
for ( i = 0; i < values.length; i++ ) {
412410
t.throws( badValue( values[ i ] ), TypeError, 'throws an error when provided ' + values[ i ] );
@@ -517,7 +515,7 @@ tape( 'the function returns the first index of an element which passes a test (r
517515
});
518516

519517
actual = findIndex( x, y, clbk );
520-
expected = [ 1, -1 ];
518+
expected = [ 1, 1 ];
521519

522520
t.strictEqual( isndarrayLike( actual ), true, 'returns expected value' );
523521
t.strictEqual( getDType( actual ), 'generic', 'returns expected value' );
@@ -593,7 +591,7 @@ tape( 'the function supports specifying operation dimensions (row-major)', funct
593591
};
594592

595593
actual = findIndex( x, y, opts, clbk );
596-
expected = [ 1, -1 ];
594+
expected = [ 1, 1 ];
597595

598596
t.strictEqual( isndarrayLike( actual ), true, 'returns expected value' );
599597
t.strictEqual( getDType( actual ), 'generic', 'returns expected value' );
@@ -624,7 +622,7 @@ tape( 'the function supports specifying an operation dimension (column-major)',
624622
};
625623

626624
actual = findIndex( x, y, opts, clbk );
627-
expected = [ 1, -1 ];
625+
expected = [ 1, 1 ];
628626

629627
t.strictEqual( isndarrayLike( actual ), true, 'returns expected value' );
630628
t.strictEqual( getDType( actual ), 'generic', 'returns expected value' );
@@ -675,15 +673,15 @@ tape( 'the function supports providing an execution context', function test( t )
675673
};
676674

677675
actual = findIndex( x, y, clbk1, ctx );
678-
expected = [ 1, -1 ];
676+
expected = [ 1, 1 ];
679677

680678
t.strictEqual( isndarrayLike( actual ), true, 'returns expected value' );
681679
t.strictEqual( getDType( actual ), 'generic', 'returns expected value' );
682680
t.deepEqual( getShape( actual ), [ 2 ], 'returns expected value' );
683681
t.strictEqual( getOrder( actual ), getOrder( x ), 'returns expected value' );
684682
t.strictEqual( isSameArray( getData( actual ), expected ), true, 'returns expected value' );
685683
t.strictEqual( ( y === actual ), true, 'returns expected value' );
686-
t.strictEqual( ctx.count, 1, 'returns expected value' );
684+
t.strictEqual( ctx.count, 4, 'returns expected value' );
687685

688686
t.end();
689687

lib/node_modules/@stdlib/blas/ext/find-index/test/test.main.js

Lines changed: 12 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -180,8 +180,7 @@ tape( 'the function throws an error if provided a second argument which is not a
180180
false,
181181
null,
182182
void 0,
183-
[],
184-
function noop() {}
183+
[]
185184
];
186185
for ( i = 0; i < values.length; i++ ) {
187186
t.throws( badValue( values[ i ] ), TypeError, 'throws an error when provided ' + values[ i ] );
@@ -210,8 +209,7 @@ tape( 'the function throws an error if provided a second argument which is not a
210209
false,
211210
null,
212211
void 0,
213-
[],
214-
function noop() {}
212+
[]
215213
];
216214
for ( i = 0; i < values.length; i++ ) {
217215
t.throws( badValue( values[ i ] ), TypeError, 'throws an error when provided ' + values[ i ] );
@@ -240,8 +238,7 @@ tape( 'the function throws an error if provided a second argument which is not a
240238
false,
241239
null,
242240
void 0,
243-
[],
244-
function noop() {}
241+
[]
245242
];
246243
for ( i = 0; i < values.length; i++ ) {
247244
t.throws( badValue( values[ i ] ), TypeError, 'throws an error when provided ' + values[ i ] );
@@ -270,8 +267,7 @@ tape( 'the function throws an error if provided a second argument which is not a
270267
false,
271268
null,
272269
void 0,
273-
[],
274-
function noop() {}
270+
[]
275271
];
276272
for ( i = 0; i < values.length; i++ ) {
277273
t.throws( badValue( values[ i ] ), TypeError, 'throws an error when provided ' + values[ i ] );
@@ -321,8 +317,7 @@ tape( 'the function throws an error if provided an options argument which is not
321317
false,
322318
null,
323319
void 0,
324-
[],
325-
function noop() {}
320+
[]
326321
];
327322
for ( i = 0; i < values.length; i++ ) {
328323
t.throws( badValue( values[ i ] ), TypeError, 'throws an error when provided ' + values[ i ] );
@@ -352,8 +347,7 @@ tape( 'the function throws an error if provided an options argument which is not
352347
false,
353348
null,
354349
void 0,
355-
[],
356-
function noop() {}
350+
[]
357351
];
358352
for ( i = 0; i < values.length; i++ ) {
359353
t.throws( badValue( values[ i ] ), TypeError, 'throws an error when provided ' + values[ i ] );
@@ -511,7 +505,7 @@ tape( 'the function returns the first index of an element which passes a test (r
511505
x = new ndarray( 'generic', xbuf, [ 2, 2 ], [ 2, 1 ], 0, 'row-major' );
512506

513507
actual = findIndex( x, clbk );
514-
expected = [ 1, -1 ];
508+
expected = [ 1, 1 ];
515509

516510
t.strictEqual( isndarrayLike( actual ), true, 'returns expected value' );
517511
t.strictEqual( getDType( actual ), 'generic', 'returns expected value' );
@@ -572,7 +566,7 @@ tape( 'the function supports specifying the operation dimension (row-major)', fu
572566
};
573567

574568
actual = findIndex( x, opts, clbk );
575-
expected = [ 1, -1 ];
569+
expected = [ 1, 1 ];
576570

577571
t.strictEqual( isndarrayLike( actual ), true, 'returns expected value' );
578572
t.strictEqual( getDType( actual ), 'generic', 'returns expected value' );
@@ -597,7 +591,7 @@ tape( 'the function supports specifying the operation dimension (column-major)',
597591
};
598592

599593
actual = findIndex( x, opts, clbk );
600-
expected = [ 1, -1 ];
594+
expected = [ 1, 1 ];
601595

602596
t.strictEqual( isndarrayLike( actual ), true, 'returns expected value' );
603597
t.strictEqual( getDType( actual ), 'generic', 'returns expected value' );
@@ -637,7 +631,7 @@ tape( 'the function supports specifying the output array data type', function te
637631
};
638632

639633
actual = findIndex( x, opts, clbk );
640-
expected = [ 1, -1 ];
634+
expected = [ 1, 1 ];
641635

642636
t.strictEqual( isndarrayLike( actual ), true, 'returns expected value' );
643637
t.strictEqual( getDType( actual ), 'int32', 'returns expected value' );
@@ -660,16 +654,15 @@ tape( 'the function supports providing an execution context', function test( t )
660654
ctx = {
661655
'count': 0
662656
};
663-
664657
actual = findIndex( x, clbk1, ctx );
665-
expected = [ 1, -1 ];
658+
expected = [ 1, 1 ];
666659

667660
t.strictEqual( isndarrayLike( actual ), true, 'returns expected value' );
668661
t.strictEqual( getDType( actual ), 'generic', 'returns expected value' );
669662
t.deepEqual( getShape( actual ), [ 2 ], 'returns expected value' );
670663
t.strictEqual( getOrder( actual ), getOrder( x ), 'returns expected value' );
671664
t.deepEqual( ndarray2array( actual ), expected, 'returns expected value' );
672-
t.strictEqual( ctx.count, 1, 'returns expected value' );
665+
t.strictEqual( ctx.count, 4, 'returns expected value' );
673666

674667
t.end();
675668

0 commit comments

Comments
 (0)