Skip to content

Commit 71e8e76

Browse files
committed
test: add TS test for third parameter
--- 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 632aa60 commit 71e8e76

File tree

1 file changed

+15
-0
lines changed
  • lib/node_modules/@stdlib/complex/float32/base/assert/is-almost-equal/docs/types

1 file changed

+15
-0
lines changed

lib/node_modules/@stdlib/complex/float32/base/assert/is-almost-equal/docs/types/test.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,21 @@ import isAlmostEqualf = require( './index' );
5656
isAlmostEqualf( z1, ( x: number ): number => x, 1 ); // $ExpectError
5757
}
5858

59+
// The compiler throws an error if the function is provided a third argument that is not a number...
60+
{
61+
const z1 = new Complex64( 5.0, 3.0 );
62+
const z2 = new Complex64( 5.0, 3.0 );
63+
64+
isAlmostEqualf( z1, z2, 'abc' ); // $ExpectError
65+
isAlmostEqualf( z1, z2, true ); // $ExpectError
66+
isAlmostEqualf( z1, z2, false ); // $ExpectError
67+
isAlmostEqualf( z1, z2, null ); // $ExpectError
68+
isAlmostEqualf( z1, z2, void 0 ); // $ExpectError
69+
isAlmostEqualf( z1, z2, [] ); // $ExpectError
70+
isAlmostEqualf( z1, z2, {} ); // $ExpectError
71+
isAlmostEqualf( z1, z2, ( x: number ): number => x ); // $ExpectError
72+
}
73+
5974
// The compiler throws an error if the function is provided an unsupported number of arguments...
6075
{
6176
const z1 = new Complex64( 5.0, 3.0 );

0 commit comments

Comments
 (0)