Skip to content

Commit 38ad0f4

Browse files
committed
test: add test
--- 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 39c022b commit 38ad0f4

File tree

1 file changed

+31
-4
lines changed

1 file changed

+31
-4
lines changed

lib/node_modules/@stdlib/lapack/base/iladlr/test/test.iladlr.js

Lines changed: 31 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,34 @@ tape( 'the function throws an error if provided a fifth argument which is not a
111111
}
112112
});
113113

114-
tape( 'the function returns an invalid index (-1) when M is zero', function test( t ) {
114+
tape( 'the function throws an error if provided a fifth argument which is not a valid `LDA` value (column-major)', function test( t ) {
115+
var values;
116+
var data;
117+
var A;
118+
var i;
119+
120+
data = COLUMN_MAJOR_DATA;
121+
122+
values = [
123+
0,
124+
1
125+
];
126+
127+
A = new Float64Array( data.A );
128+
129+
for ( i = 0; i < values.length; i++ ) {
130+
t.throws( badValue( values[ i ] ), RangeError, 'throws an error when provided ' + values[ i ] );
131+
}
132+
t.end();
133+
134+
function badValue( value ) {
135+
return function badValue() {
136+
iladlr( data.order, data.M, data.N, A, value );
137+
};
138+
}
139+
});
140+
141+
tape( 'the function returns an invalid index (-1) when M is less than or equal to zero', function test( t ) {
115142
var data;
116143
var out;
117144
var A;
@@ -125,7 +152,7 @@ tape( 'the function returns an invalid index (-1) when M is zero', function test
125152
t.end();
126153
});
127154

128-
tape( 'the function returns an invalid index (-1) when N is zero', function test( t ) {
155+
tape( 'the function returns an invalid index (-1) when N is less than or equal to zero', function test( t ) {
129156
var data;
130157
var out;
131158
var A;
@@ -139,7 +166,7 @@ tape( 'the function returns an invalid index (-1) when N is zero', function test
139166
t.end();
140167
});
141168

142-
tape( 'the function returns the expected zero based index of the last non-zero row of a matrix (row-major)', function test( t ) {
169+
tape( 'the function returns the expected zero-based index of the last non-zero row of a matrix (row-major)', function test( t ) {
143170
var data;
144171
var out;
145172
var A;
@@ -153,7 +180,7 @@ tape( 'the function returns the expected zero based index of the last non-zero r
153180
t.end();
154181
});
155182

156-
tape( 'the function returns the expected zero based index of the last non-zero row of a matrix (column-major)', function test( t ) {
183+
tape( 'the function returns the expected zero-based index of the last non-zero row of a matrix (column-major)', function test( t ) {
157184
var data;
158185
var out;
159186
var A;

0 commit comments

Comments
 (0)