From 6ceb77270633b7f4abecdff4f3a9a69a2c3b5f02 Mon Sep 17 00:00:00 2001 From: Payal Goswami Date: Sun, 4 Jan 2026 11:49:35 +0000 Subject: [PATCH] test: add even-function property test for cosh --- 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: passed - task: lint_typescript_tests status: na - task: lint_license_headers status: passed --- --- .../math/base/special/cosh/test/test.js | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/lib/node_modules/@stdlib/math/base/special/cosh/test/test.js b/lib/node_modules/@stdlib/math/base/special/cosh/test/test.js index 5c4ea7d5ab3b..ab2e856e2fd5 100644 --- a/lib/node_modules/@stdlib/math/base/special/cosh/test/test.js +++ b/lib/node_modules/@stdlib/math/base/special/cosh/test/test.js @@ -44,6 +44,25 @@ tape( 'main export is a function', function test( t ) { t.end(); }); +tape( 'the function is an even function', function test( t ) { + var x; + var i; + + x = [ + 0.5, + 1.0, + 3.5, + 10.0, + 50.0, + 100.0 + ]; + + for ( i = 0; i < x.length; i++ ) { + t.strictEqual( cosh( x[ i ] ), cosh( -x[ i ] ), 'returns same value for ' + x[ i ] + ' and -' + x[ i ] ); + } + t.end(); +}); + tape( 'the function computes the hyperbolic cosine', function test( t ) { var expected; var delta;