Skip to content

Commit c2fa56c

Browse files
committed
test: add negative 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: passed - 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: na - task: lint_license_headers status: passed ---
1 parent 2e8d355 commit c2fa56c

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

lib/node_modules/@stdlib/blas/base/icamax/test/test.ndarray.js

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,27 @@ tape( 'the function supports specifying a stride', function test( t ) {
155155
t.end();
156156
});
157157

158+
tape( 'the function supports specifying a negative stride', function test( t ) {
159+
var expected;
160+
var idx;
161+
var x;
162+
163+
x = new Complex64Array( [ 3.0, -4.0, 1.0, 15.0, 4.0, 3.0 ] );
164+
expected = 1;
165+
166+
idx = icamax( x.length, x, -1, 2 );
167+
t.strictEqual( idx, expected, 'returns expected value' );
168+
169+
// eslint-disable-next-line max-len
170+
x = new Complex64Array( [ 0.1, 4.0, 999.0, 999.0, -0.3, 6.0, 999.0, 999.0, -0.5, 7.0, 999.0, 999.0, -0.1, 3.0 ] );
171+
expected = 1;
172+
173+
idx = icamax( 4, x, -2, 6 );
174+
t.strictEqual( idx, expected, 'returns expected value' );
175+
176+
t.end();
177+
});
178+
158179
tape( 'the function supports specifying an `x` offset', function test( t ) {
159180
var expected;
160181
var idx;

0 commit comments

Comments
 (0)