From e6b22ec32ccdc03a3721c79b007ef67b6db196c6 Mon Sep 17 00:00:00 2001 From: Piyush Date: Wed, 17 Dec 2025 16:04:54 +0530 Subject: [PATCH 1/4] test: add non-numeric argument test to string/base/format-interpolate --- 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 --- --- .../test/test.format_integer.js | 50 +++++++++++++++++++ 1 file changed, 50 insertions(+) diff --git a/lib/node_modules/@stdlib/string/base/format-interpolate/test/test.format_integer.js b/lib/node_modules/@stdlib/string/base/format-interpolate/test/test.format_integer.js index 9242698bc7ef..95e59b4fa73f 100644 --- a/lib/node_modules/@stdlib/string/base/format-interpolate/test/test.format_integer.js +++ b/lib/node_modules/@stdlib/string/base/format-interpolate/test/test.format_integer.js @@ -168,3 +168,53 @@ tape( 'the function returns an integer-formatted token argument (precision)', fu t.end(); }); + +tape( 'the function throws an error for non-numeric input', function test( t ) { + var token; + + token = { + 'specifier': 'd', + 'arg': 'abc' + }; + + t.throws( badToken( token ), Error, 'throws an error when provided arg '+token.arg ); + + t.end(); + + function badToken( token ) { + return function badToken() { + formatInteger( token ); + }; + } +}); + +tape( 'the function coerces non-finite numeric input to empty string', function test( t ) { + var expected; + var actual; + var token; + + expected = ''; + + token = { + 'specifier': 'd', + 'arg': NaN + }; + actual = formatInteger( token ); + t.strictEqual( actual, expected, 'returns expected empty string' ); + + token = { + 'specifier': 'd', + 'arg': Infinity + }; + actual = formatInteger( token ); + t.strictEqual( actual, expected, 'returns expected empty string' ); + + token = { + 'specifier': 'd', + 'arg': -Infinity + }; + actual = formatInteger( token ); + t.strictEqual( actual, expected, 'returns expected empty string' ); + + t.end(); +}); From 020af78de6e7f1d6e42c7402e5f617e9ffccc1d3 Mon Sep 17 00:00:00 2001 From: piyxsh31 Date: Mon, 9 Feb 2026 09:04:16 +0530 Subject: [PATCH 2/4] Update lib/node_modules/@stdlib/string/base/format-interpolate/test/test.format_integer.js Co-authored-by: Philipp Burckhardt Signed-off-by: piyxsh31 --- .../string/base/format-interpolate/test/test.format_integer.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/node_modules/@stdlib/string/base/format-interpolate/test/test.format_integer.js b/lib/node_modules/@stdlib/string/base/format-interpolate/test/test.format_integer.js index 95e59b4fa73f..9a3904f160e0 100644 --- a/lib/node_modules/@stdlib/string/base/format-interpolate/test/test.format_integer.js +++ b/lib/node_modules/@stdlib/string/base/format-interpolate/test/test.format_integer.js @@ -200,7 +200,7 @@ tape( 'the function coerces non-finite numeric input to empty string', function 'arg': NaN }; actual = formatInteger( token ); - t.strictEqual( actual, expected, 'returns expected empty string' ); + t.strictEqual( actual, expected, 'returns expected value' ); token = { 'specifier': 'd', From 2ea4ac4b2ada2b1c5b3166d9438f4cbf84d7d5db Mon Sep 17 00:00:00 2001 From: piyxsh31 Date: Mon, 9 Feb 2026 09:04:32 +0530 Subject: [PATCH 3/4] Update lib/node_modules/@stdlib/string/base/format-interpolate/test/test.format_integer.js Co-authored-by: Philipp Burckhardt Signed-off-by: piyxsh31 --- .../string/base/format-interpolate/test/test.format_integer.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/node_modules/@stdlib/string/base/format-interpolate/test/test.format_integer.js b/lib/node_modules/@stdlib/string/base/format-interpolate/test/test.format_integer.js index 9a3904f160e0..70299bb24be7 100644 --- a/lib/node_modules/@stdlib/string/base/format-interpolate/test/test.format_integer.js +++ b/lib/node_modules/@stdlib/string/base/format-interpolate/test/test.format_integer.js @@ -207,7 +207,7 @@ tape( 'the function coerces non-finite numeric input to empty string', function 'arg': Infinity }; actual = formatInteger( token ); - t.strictEqual( actual, expected, 'returns expected empty string' ); + t.strictEqual( actual, expected, 'returns expected value' ); token = { 'specifier': 'd', From 9b4a97cd0800c41ef1f03e8590905cbc7dd9bb6f Mon Sep 17 00:00:00 2001 From: piyxsh31 Date: Mon, 9 Feb 2026 09:04:45 +0530 Subject: [PATCH 4/4] Update lib/node_modules/@stdlib/string/base/format-interpolate/test/test.format_integer.js Co-authored-by: Philipp Burckhardt Signed-off-by: piyxsh31 --- .../string/base/format-interpolate/test/test.format_integer.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/node_modules/@stdlib/string/base/format-interpolate/test/test.format_integer.js b/lib/node_modules/@stdlib/string/base/format-interpolate/test/test.format_integer.js index 70299bb24be7..9e23e472d5ec 100644 --- a/lib/node_modules/@stdlib/string/base/format-interpolate/test/test.format_integer.js +++ b/lib/node_modules/@stdlib/string/base/format-interpolate/test/test.format_integer.js @@ -214,7 +214,7 @@ tape( 'the function coerces non-finite numeric input to empty string', function 'arg': -Infinity }; actual = formatInteger( token ); - t.strictEqual( actual, expected, 'returns expected empty string' ); + t.strictEqual( actual, expected, 'returns expected value' ); t.end(); });