Skip to content

Commit 83203af

Browse files
committed
test: add missing test case
--- 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 ac01c59 commit 83203af

File tree

1 file changed

+33
-0
lines changed
  • lib/node_modules/@stdlib/ndarray/fill-slice/test

1 file changed

+33
-0
lines changed

lib/node_modules/@stdlib/ndarray/fill-slice/test/test.js

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,39 @@ tape( 'the function throws an error if provided a first argument which is a read
8888
}
8989
});
9090

91+
tape( 'the function throws an error if provided a second argument which is not a `MultiSlice` instance', function test( t ) {
92+
var values;
93+
var i;
94+
var x;
95+
96+
x = scalar2ndarray( 0.0, {
97+
'dtype': 'float64'
98+
});
99+
100+
values = [
101+
'5',
102+
5,
103+
NaN,
104+
true,
105+
false,
106+
null,
107+
void 0,
108+
[],
109+
{},
110+
function noop() {}
111+
];
112+
for ( i = 0; i < values.length; i++ ) {
113+
t.throws( badValue( values[ i ] ), TypeError, 'throws an error when provided ' + values[ i ] );
114+
}
115+
t.end();
116+
117+
function badValue( value ) {
118+
return function badValue() {
119+
fillSlice( x, value, 10.0 );
120+
};
121+
}
122+
});
123+
91124
tape( 'the function throws an error if provided a third argument which cannot be safely cast to the input ndarray data type', function test( t ) {
92125
var values;
93126
var x;

0 commit comments

Comments
 (0)