Skip to content

Commit 8483f68

Browse files
committed
test: add 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 6e5fa88 commit 8483f68

File tree

1 file changed

+39
-0
lines changed

1 file changed

+39
-0
lines changed

lib/node_modules/@stdlib/ndarray/concat/test/test.assign.js

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,45 @@ tape( 'the function throws an error if provided a second argument which is not a
115115
}
116116
});
117117

118+
tape( 'the function throws an error if provided a third argument which is not a negative integer', function test( t ) {
119+
var values;
120+
var x;
121+
var y;
122+
var z;
123+
var i;
124+
125+
x = zeros( [ 2, 2 ] );
126+
y = zeros( [ 2, 2 ] );
127+
z = zeros( [ 2, 4 ] );
128+
129+
values = [
130+
'5',
131+
5.5,
132+
0,
133+
1,
134+
2,
135+
NaN,
136+
true,
137+
false,
138+
null,
139+
void 0,
140+
[],
141+
{},
142+
function noop() {}
143+
];
144+
145+
for ( i = 0; i < values.length; i++ ) {
146+
t.throws( badValue( values[ i ] ), TypeError, 'throws an error when provided ' + values[ i ] );
147+
}
148+
t.end();
149+
150+
function badValue( value ) {
151+
return function badValue() {
152+
assign( [ x, y ], z, value );
153+
};
154+
}
155+
});
156+
118157
tape( 'the function concatenates ndarrays along a specified dimension', function test( t ) {
119158
var expected;
120159
var actual;

0 commit comments

Comments
 (0)