Skip to content

Commit a208397

Browse files
committed
Add tests
1 parent 4bb310b commit a208397

File tree

1 file changed

+20
-0
lines changed
  • lib/node_modules/@stdlib/types

1 file changed

+20
-0
lines changed

lib/node_modules/@stdlib/types/test.ts

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,26 @@ function cmplx128Array(): array.Complex128Array {
240240
if ( zzz.byteOffset !== 0 ) {
241241
throw new Error( 'something went wrong' );
242242
}
243+
244+
const v1: array.ArrayOrTypedArray = new Float64Array( 10 );
245+
if ( v1[ 0 ] !== 0.0 ) {
246+
throw new Error( 'something went wrong' );
247+
}
248+
249+
const v2: array.FloatTypedArray = new Float64Array( 10 );
250+
if ( v2[ 0 ] !== 0.0 ) {
251+
throw new Error( 'something went wrong' );
252+
}
253+
254+
const v3: array.RealOrComplexArray = new Float64Array( 10 );
255+
if ( v3[ 0 ] !== 0.0 ) {
256+
throw new Error( 'something went wrong' );
257+
}
258+
259+
const v4: array.RealOrComplexTypedArray = new Float64Array( 10 );
260+
if ( v4[ 0 ] !== 0.0 ) {
261+
throw new Error( 'something went wrong' );
262+
}
243263
}
244264

245265
// The compiler should not throw an error when using iterator or iterable types...

0 commit comments

Comments
 (0)