Skip to content

Commit 15144b7

Browse files
committed
test: add tests for full code coverage
--- 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 b5c1ed2 commit 15144b7

File tree

1 file changed

+35
-1
lines changed

1 file changed

+35
-1
lines changed

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

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -490,7 +490,41 @@ tape( 'the function throws an error if provided a first argument which is a zero
490490
}
491491
});
492492

493-
tape( 'the function throws an error if provided a third argument which is not an ndarray-like object, an integer, or an object', function test( t ) {
493+
tape( 'the function throws an error if provided a fromIndex argument which is not an ndarray-like object, an integer, or an object', function test( t ) {
494+
var values;
495+
var i;
496+
var x;
497+
var y;
498+
499+
x = zeros( [ 2, 2 ], {
500+
'dtype': 'float64'
501+
});
502+
y = zeros( [], {
503+
'dtype': 'generic'
504+
});
505+
values = [
506+
'5',
507+
NaN,
508+
true,
509+
false,
510+
null,
511+
void 0,
512+
[],
513+
function noop() {}
514+
];
515+
for ( i = 0; i < values.length; i++ ) {
516+
t.throws( badValue( values[ i ] ), TypeError, 'throws an error when provided ' + values[ i ] );
517+
}
518+
t.end();
519+
520+
function badValue( value ) {
521+
return function badValue() {
522+
lastIndexOf( x, scalar2ndarray( 2.0 ), value, y );
523+
};
524+
}
525+
});
526+
527+
tape( 'the function throws an error if provided a fromIndex argument which is not an ndarray-like object, an integer, or an object (options)', function test( t ) {
494528
var values;
495529
var i;
496530
var x;

0 commit comments

Comments
 (0)