Skip to content

Commit 0e9907c

Browse files
committed
test: add test to check uplo
--- 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 a8ca2ba commit 0e9907c

File tree

2 files changed

+78
-0
lines changed

2 files changed

+78
-0
lines changed

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

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,45 @@ tape( 'the function throws an error if provided a first argument which is not a
110110
}
111111
});
112112

113+
tape( 'the function throws an error if provided a second argument which is not a valid side', function test( t ) {
114+
var values;
115+
var out;
116+
var AP;
117+
var S;
118+
var i;
119+
120+
values = [
121+
'foo',
122+
'bar',
123+
'beep',
124+
'boop',
125+
-5,
126+
NaN,
127+
true,
128+
false,
129+
null,
130+
void 0,
131+
[],
132+
{},
133+
function noop() {}
134+
];
135+
136+
AP = new Float64Array( [ 1.0, 2.0, 3.0, 5.0, 6.0, 9.0 ] );
137+
S = new Float64Array( 3 );
138+
out = new Float64Array( 2 );
139+
140+
for ( i = 0; i < values.length; i++ ) {
141+
t.throws( badValue( values[ i ] ), TypeError, 'throws an error when provided ' + values[ i ] );
142+
}
143+
t.end();
144+
145+
function badValue( value ) {
146+
return function badValue() {
147+
dppequ( 'row-major', value, 3, AP, S, out );
148+
};
149+
}
150+
});
151+
113152
tape( 'the function leaves the row and column scaling factors intended to equilibrate a symmetric positive definite matrix `A` in packed storage unchanged if N is equal to 0', function test( t ) {
114153
var expectedOut;
115154
var expectedS;

lib/node_modules/@stdlib/lapack/base/dppequ/test/test.ndarray.js

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,45 @@ tape( 'the function throws an error if provided a first argument which is not a
110110
}
111111
});
112112

113+
tape( 'the function throws an error if provided a second argument which is not a valid side', function test( t ) {
114+
var values;
115+
var out;
116+
var AP;
117+
var S;
118+
var i;
119+
120+
values = [
121+
'foo',
122+
'bar',
123+
'beep',
124+
'boop',
125+
-5,
126+
NaN,
127+
true,
128+
false,
129+
null,
130+
void 0,
131+
[],
132+
{},
133+
function noop() {}
134+
];
135+
136+
AP = new Float64Array( [ 1.0, 2.0, 3.0, 5.0, 6.0, 9.0 ] );
137+
S = new Float64Array( 3 );
138+
out = new Float64Array( 2 );
139+
140+
for ( i = 0; i < values.length; i++ ) {
141+
t.throws( badValue( values[ i ] ), TypeError, 'throws an error when provided ' + values[ i ] );
142+
}
143+
t.end();
144+
145+
function badValue( value ) {
146+
return function badValue() {
147+
dppequ( 'row-major', value, 3, AP, 1, 0, S, 1, 0, out, 1, 0 );
148+
};
149+
}
150+
});
151+
113152
tape( 'the function leaves the row and column scaling factors intended to equilibrate a symmetric positive definite matrix `A` in packed storage unchanged if N is equal to 0', function test( t ) {
114153
var expectedOut;
115154
var expectedS;

0 commit comments

Comments
 (0)