Skip to content

Commit 0b1a520

Browse files
committed
docs: update test.ts for assign and stride
--- 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 28f9780 commit 0b1a520

File tree

1 file changed

+53
-3
lines changed
  • lib/node_modules/@stdlib/math/base/special/csignumf/docs/types

1 file changed

+53
-3
lines changed

lib/node_modules/@stdlib/math/base/special/csignumf/docs/types/test.ts

Lines changed: 53 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/*
1+
/**
22
* @license Apache-2.0
33
*
44
* Copyright (c) 2025 The Stdlib Authors.
@@ -22,12 +22,12 @@ import csignumf = require( './index' );
2222

2323
// TESTS //
2424

25-
// The function returns an array of numbers...
25+
// The function returns a Complex64...
2626
{
2727
csignumf( new Complex64( 1.0, 2.0 ) ); // $ExpectType Complex64
2828
}
2929

30-
// The compiler throws an error if the function is provided a value other than a complex number...
30+
// The compiler throws an error if the function is provided a value other than a Complex64...
3131
{
3232
csignumf( true ); // $ExpectError
3333
csignumf( false ); // $ExpectError
@@ -43,3 +43,53 @@ import csignumf = require( './index' );
4343
{
4444
csignumf(); // $ExpectError
4545
}
46+
47+
// assign(): returns the same array type
48+
{
49+
const out = new Float32Array( 2 );
50+
csignumf.assign( 1.0, 2.0, out, 1, 0 ); // $ExpectType Float32Array
51+
}
52+
53+
// assign(): accepts generic collections
54+
{
55+
const out = [ 0.0, 0.0 ];
56+
csignumf.assign( 1.0, 2.0, out, 1, 0 ); // $ExpectType number[]
57+
}
58+
59+
// assign(): compiler errors for invalid args
60+
{
61+
const out = new Float32Array( 2 );
62+
csignumf.assign( '1', 2.0, out, 1, 0 ); // $ExpectError
63+
csignumf.assign( 1.0, true, out, 1, 0 ); // $ExpectError
64+
csignumf.assign( 1.0, 2.0, {}, 1, 0 ); // $ExpectError
65+
csignumf.assign( 1.0, 2.0, out, '1', 0 ); // $ExpectError
66+
csignumf.assign( 1.0, 2.0, out, 1, '0' ); // $ExpectError
67+
csignumf.assign(); // $ExpectError
68+
}
69+
70+
// strided(): returns the same array type as output
71+
{
72+
const z = new Float32Array( [ 3.0, 4.0 ] );
73+
const out = new Float32Array( 2 );
74+
csignumf.strided( z, 2, 0, out, 2, 0 ); // $ExpectType Float32Array
75+
}
76+
77+
// strided(): accepts generic collections
78+
{
79+
const z = [ 3.0, 4.0 ];
80+
const out = [ 0.0, 0.0 ];
81+
csignumf.strided( z, 2, 0, out, 2, 0 ); // $ExpectType number[]
82+
}
83+
84+
// strided(): compiler errors for invalid args
85+
{
86+
const z = new Float32Array( 2 );
87+
const out = new Float32Array( 2 );
88+
csignumf.strided( 'z', 2, 0, out, 2, 0 ); // $ExpectError
89+
csignumf.strided( z, true, 0, out, 2, 0 ); // $ExpectError
90+
csignumf.strided( z, 2, {}, out, 2, 0 ); // $ExpectError
91+
csignumf.strided( z, 2, 0, 42, 2, 0 ); // $ExpectError
92+
csignumf.strided( z, 2, 0, out, '2', 0 ); // $ExpectError
93+
csignumf.strided( z, 2, 0, out, 2, [] ); // $ExpectError
94+
csignumf.strided(); // $ExpectError
95+
}

0 commit comments

Comments
 (0)