Skip to content

Commit 430e0fa

Browse files
committed
chore: add test cases
--- 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: na - 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: passed - task: lint_license_headers status: passed ---
1 parent fa5e338 commit 430e0fa

File tree

1 file changed

+48
-29
lines changed
  • lib/node_modules/@stdlib/blas/base/wasm/sdsdot/docs/types

1 file changed

+48
-29
lines changed

lib/node_modules/@stdlib/blas/base/wasm/sdsdot/docs/types/test.ts

Lines changed: 48 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ import sdsdot = require( './index' );
2929
const x = new Float32Array( 10 );
3030
const y = new Float32Array( 10 );
3131

32-
sdsdot.main( x.length, 0.0, 0.0, x, 1, y, 1 ); // $ExpectType number
32+
sdsdot.main( x.length, 0.0, x, 1, y, 1 ); // $ExpectType number
3333
}
3434

3535
// The compiler throws an error if the `main` method is provided a first argument which is not a number...
@@ -130,7 +130,8 @@ import sdsdot = require( './index' );
130130

131131
sdsdot.main(); // $ExpectError
132132
sdsdot.main( x.length ); // $ExpectError
133-
sdsdot.main( x.length, x ); // $ExpectError
133+
sdsdot.main( x.length, 0.0 ); // $ExpectError
134+
sdsdot.main( x.length, 0.0, x ); // $ExpectError
134135
sdsdot.main( x.length, 0.0, x, 1 ); // $ExpectError
135136
sdsdot.main( x.length, 0.0, x, 1, y ); // $ExpectError
136137
sdsdot.main( x.length, 0.0, x, 1, y, 1, 10 ); // $ExpectError
@@ -250,7 +251,7 @@ import sdsdot = require( './index' );
250251
sdsdot.ndarray( x.length, 0.0, x, 1, 0, y, ( x: number ): number => x, 0 ); // $ExpectError
251252
}
252253

253-
// The compiler throws an error if the `ndarray` method is provided a eighth argument which is not a number...
254+
// The compiler throws an error if the `ndarray` method is provided an eighth argument which is not a number...
254255
{
255256
const x = new Float32Array( 10 );
256257
const y = new Float32Array( 10 );
@@ -272,7 +273,8 @@ import sdsdot = require( './index' );
272273

273274
sdsdot.ndarray(); // $ExpectError
274275
sdsdot.ndarray( x.length ); // $ExpectError
275-
sdsdot.ndarray( x.length, x ); // $ExpectError
276+
sdsdot.ndarray( x.length, 0.0 ); // $ExpectError
277+
sdsdot.ndarray( x.length, 0.0, x ); // $ExpectError
276278
sdsdot.ndarray( x.length, 0.0, x, 1 ); // $ExpectError
277279
sdsdot.ndarray( x.length, 0.0, x, 1, 0 ); // $ExpectError
278280
sdsdot.ndarray( x.length, 0.0, x, 1, 0, y ); // $ExpectError
@@ -335,14 +337,14 @@ import sdsdot = require( './index' );
335337
});
336338
const mod = sdsdot.Module( mem );
337339

338-
mod.main( 10, '10', 1, 80, 1 ); // $ExpectError
339-
mod.main( 10, true, 1, 80, 1 ); // $ExpectError
340-
mod.main( 10, false, 1, 80, 1 ); // $ExpectError
341-
mod.main( 10, null, 1, 80, 1 ); // $ExpectError
342-
mod.main( 10, undefined, 1, 80, 1 ); // $ExpectError
343-
mod.main( 10, [], 1, 80, 1 ); // $ExpectError
344-
mod.main( 10, {}, 1, 80, 1 ); // $ExpectError
345-
mod.main( 10, ( x: number ): number => x, 1, 80, 1 ); // $ExpectError
340+
mod.main( 10, '10', 10, 1, 80, 1 ); // $ExpectError
341+
mod.main( 10, true, 10, 1, 80, 1 ); // $ExpectError
342+
mod.main( 10, false, 10, 1, 80, 1 ); // $ExpectError
343+
mod.main( 10, null, 10, 1, 80, 1 ); // $ExpectError
344+
mod.main( 10, undefined, 10, 1, 80, 1 ); // $ExpectError
345+
mod.main( 10, [], 10, 1, 80, 1 ); // $ExpectError
346+
mod.main( 10, {}, 10, 1, 80, 1 ); // $ExpectError
347+
mod.main( 10, ( x: number ): number => x, 10, 1, 80, 1 ); // $ExpectError
346348
}
347349

348350
// The compiler throws an error if the `main` method of a module instance is provided a third argument which is not a number...
@@ -463,14 +465,14 @@ import sdsdot = require( './index' );
463465
});
464466
const mod = sdsdot.Module( mem );
465467

466-
mod.ndarray( 10, '10', 1, 0, 80, 1, 0 ); // $ExpectError
467-
mod.ndarray( 10, true, 1, 0, 80, 1, 0 ); // $ExpectError
468-
mod.ndarray( 10, false, 1, 0, 80, 1, 0 ); // $ExpectError
469-
mod.ndarray( 10, null, 1, 0, 80, 1, 0 ); // $ExpectError
470-
mod.ndarray( 10, undefined, 1, 0, 80, 1, 0 ); // $ExpectError
471-
mod.ndarray( 10, [], 1, 0, 80, 1, 0 ); // $ExpectError
472-
mod.ndarray( 10, {}, 1, 0, 80, 1, 0 ); // $ExpectError
473-
mod.ndarray( 10, ( x: number ): number => x, x, 1, 0, 80, 1, 0 ); // $ExpectError
468+
mod.ndarray( 10, '10', 0, 1, 0, 80, 1, 0 ); // $ExpectError
469+
mod.ndarray( 10, true, 0, 1, 0, 80, 1, 0 ); // $ExpectError
470+
mod.ndarray( 10, false, 0, 1, 0, 80, 1, 0 ); // $ExpectError
471+
mod.ndarray( 10, null, 0, 1, 0, 80, 1, 0 ); // $ExpectError
472+
mod.ndarray( 10, undefined, 0, 1, 0, 80, 1, 0 ); // $ExpectError
473+
mod.ndarray( 10, [], 0, 1, 0, 80, 1, 0 ); // $ExpectError
474+
mod.ndarray( 10, {}, 0, 1, 0, 80, 1, 0 ); // $ExpectError
475+
mod.ndarray( 10, ( x: number ): number => x, 0, 1, 0, 80, 1, 0 ); // $ExpectError
474476
}
475477

476478
// The compiler throws an error if the `ndarray` method of a module instance is provided a third argument which is not a number...
@@ -480,14 +482,14 @@ import sdsdot = require( './index' );
480482
});
481483
const mod = sdsdot.Module( mem );
482484

483-
mod.ndarray( 10, 0, '10', 0, 80, 1, 0 ); // $ExpectError
484-
mod.ndarray( 10, 0, true, 0, 80, 1, 0 ); // $ExpectError
485-
mod.ndarray( 10, 0, false, 0, 80, 1, 0 ); // $ExpectError
486-
mod.ndarray( 10, 0, null, 0, 80, 1, 0 ); // $ExpectError
487-
mod.ndarray( 10, 0, undefined, 0, 80, 1, 0 ); // $ExpectError
488-
mod.ndarray( 10, 0, [], 0, 80, 1, 0 ); // $ExpectError
489-
mod.ndarray( 10, 0, {}, 0, 80, 1, 0 ); // $ExpectError
490-
mod.ndarray( 10, 0, ( x: number ): number => x, x, 0, 80, 1, 0 ); // $ExpectError
485+
mod.ndarray( 10, 0, '10', 1, 0, 80, 1, 0 ); // $ExpectError
486+
mod.ndarray( 10, 0, true, 1, 0, 80, 1, 0 ); // $ExpectError
487+
mod.ndarray( 10, 0, false, 1, 0, 80, 1, 0 ); // $ExpectError
488+
mod.ndarray( 10, 0, null, 1, 0, 80, 1, 0 ); // $ExpectError
489+
mod.ndarray( 10, 0, undefined, 1, 0, 80, 1, 0 ); // $ExpectError
490+
mod.ndarray( 10, 0, [], 1, 0, 80, 1, 0 ); // $ExpectError
491+
mod.ndarray( 10, 0, {}, 1, 0, 80, 1, 0 ); // $ExpectError
492+
mod.ndarray( 10, 0, ( x: number ): number => x, 1, 0, 80, 1, 0 ); // $ExpectError
491493
}
492494

493495
// The compiler throws an error if the `ndarray` method of a module instance is provided a fourth argument which is not a number...
@@ -497,6 +499,23 @@ import sdsdot = require( './index' );
497499
});
498500
const mod = sdsdot.Module( mem );
499501

502+
mod.ndarray( 10, 0, 0, '10', 1, 80, 1, 0 ); // $ExpectError
503+
mod.ndarray( 10, 0, 0, true, 1, 80, 1, 0 ); // $ExpectError
504+
mod.ndarray( 10, 0, 0, false, 1, 80, 1, 0 ); // $ExpectError
505+
mod.ndarray( 10, 0, 0, null, 1, 80, 1, 0 ); // $ExpectError
506+
mod.ndarray( 10, 0, 0, undefined, 1, 80, 1, 0 ); // $ExpectError
507+
mod.ndarray( 10, 0, 0, [], 1, 80, 1, 0 ); // $ExpectError
508+
mod.ndarray( 10, 0, 0, {}, 1, 80, 1, 0 ); // $ExpectError
509+
mod.ndarray( 10, 0, 0, ( x: number ): number => x, 1, 80, 1, 0 ); // $ExpectError
510+
}
511+
512+
// The compiler throws an error if the `ndarray` method of a module instance is provided a fifth argument which is not a number...
513+
{
514+
const mem = new Memory({
515+
'initial': 1
516+
});
517+
const mod = sdsdot.Module( mem );
518+
500519
mod.ndarray( 10, 0, 0, 1, '10', 80, 1, 0 ); // $ExpectError
501520
mod.ndarray( 10, 0, 0, 1, true, 80, 1, 0 ); // $ExpectError
502521
mod.ndarray( 10, 0, 0, 1, false, 80, 1, 0 ); // $ExpectError
@@ -507,7 +526,7 @@ import sdsdot = require( './index' );
507526
mod.ndarray( 10, 0, 0, 1, ( x: number ): number => x, 80, 1, 0 ); // $ExpectError
508527
}
509528

510-
// The compiler throws an error if the `ndarray` method of a module instance is provided a fifth argument which is not a number...
529+
// The compiler throws an error if the `ndarray` method of a module instance is provided a sixth argument which is not a number...
511530
{
512531
const mem = new Memory({
513532
'initial': 1

0 commit comments

Comments
 (0)