Skip to content

Commit 6d31c53

Browse files
authored
fix: complete test.assign.js
Signed-off-by: Shabareesh Shetty <[email protected]>
1 parent f1277da commit 6d31c53

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

lib/node_modules/@stdlib/blas/base/srotmg/test/test.assign.js

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,37 @@ tape( 'the function returns an array of NaNs if provided a rotation elimination
129129
t.end();
130130
});
131131

132+
tape( 'the function returns an array of zeros except s equals to 1 if provided scaling factor for the first vector component equal to 0', function test(t) {
133+
var actual;
134+
var i;
135+
actual = srotmg( 0.0, 1.0, 2.0, 3.0, new Float32Array( 5 ), 1, 0 );
136+
for ( i = 0; i < actual.length; i++ ) {
137+
if ( i === 1 ) {
138+
t.strictEqual( actual[ i ], 1.0, 'returns expected value' );
139+
} else {
140+
t.strictEqual( actual[ i ], 0.0, 'returns expected value' );
141+
}
142+
}
143+
t.end();
144+
});
145+
146+
tape( 'the function returns an array with c, s value equal to 0 and param value value equal to 1 if provided scaling factor for the second vector component equal to 0', function test(t) {
147+
var actual;
148+
var i;
149+
150+
actual = srotmg( 1.0, 0.0, 2.0, 3.0, new Float32Array( 5 ), 1, 0 );
151+
for ( i = 0; i < ( actual.length - 2 ); i++ ) {
152+
if ( i === 1 ) {
153+
t.strictEqual( actual[ i ], 0.0, 'returns expected value' );
154+
} else {
155+
t.strictEqual( actual[ i ], 1.0, 'returns expected value' );
156+
}
157+
}
158+
console.log(actual);
159+
t.end();
160+
});
161+
162+
132163
tape( 'the function supports providing a positive stride', function test(t) {
133164
var expected;
134165
var actual;

0 commit comments

Comments
 (0)