Skip to content

test: ensure backward compatibility in test assertion - #13783

Merged
kgryte merged 2 commits into
developfrom
philipp/ci-fix-locale-tolocalestring-2026-07-30
Jul 30, 2026
Merged

test: ensure backward compatibility in test assertion#13783
kgryte merged 2 commits into
developfrom
philipp/ci-fix-locale-tolocalestring-2026-07-30

Conversation

@Planeshifter

Copy link
Copy Markdown
Member

Description

What is the purpose of this pull request?

This pull request:

  • fixes a hardcoded locale-specific assertion in test.to_locale_string.js for @stdlib/dstructs/named-typed-tuple that fails on Node.js versions shipping "small-icu" builds (e.g., Node.js v12 on linux_test). Failing run: https://github.com/stdlib-js/stdlib/actions/runs/30532379700. The test hardcoded 'tuple(price=123.456,789, quantity=9.876)' assuming de-DE locale data is always present; small-icu builds only carry en locale data and silently fall back to default formatting, so the assertion never matched on those runners. The fix computes expected dynamically via .toLocaleString( 'de-DE' ), matching the pattern already used by the two sibling tests in the same file.

Related Issues

Does this pull request have any related issues?

This pull request has no related issues.

Questions

Any questions for reviewers of this pull request?

No.

Other

Any other information relevant to this pull request? This may include screenshots, references, and/or implementation notes.

Verified (123456.789).toLocaleString('de-DE') produces '123.456,789' on full-icu Node.js (confirmed the fix is a no-op on full-icu runners; the assertion still catches a locale-propagation regression there). Ran the full test.to_locale_string.js suite locally (17/17 passing). Reviewed by three independent passes (correctness, regression scope, style/conventions); all approved with no blocking findings.

Checklist

Please ensure the following tasks are completed before submitting this pull request.

AI Assistance

When authoring the changes proposed in this PR, did you use any kind of AI assistance?

  • Yes
  • No

If you answered "yes" above, how did you use AI assistance?

  • Code generation (e.g., when writing an implementation or fixing a bug)
  • Test/benchmark generation
  • Documentation (including examples)
  • Research and understanding

Disclosure

If you answered "yes" to using AI assistance, please provide a short disclosure indicating how you used AI assistance. This helps reviewers determine how much scrutiny to apply when reviewing your contribution. Example disclosures: "This PR was written primarily by Claude Code." or "I consulted ChatGPT to understand the codebase, but the proposed changes were fully authored manually by myself.".

This PR was written primarily by Claude Code, run as an automated CI-failure triage routine. The root cause was diagnosed from CI logs and confirmed by direct local reproduction; the fix was reviewed by three independent automated review passes (correctness, regression scope, style) before this PR was opened.


@stdlib-js/reviewers


Generated by Claude Code

…leString` assertion

The job `Node.js v12` on workflow `linux_test` failed on develop with
a mismatched `toLocaleString` assertion in `test.to_locale_string.js`.
Root cause: the test hardcoded a literal expected string assuming
de-DE locale formatting is always available, but Node.js versions
before v13 ship "small-icu" builds by default, which only include
full locale data for "en"; other locales such as de-DE silently fall
back to default formatting. This commit computes the expected value
dynamically via `.toLocaleString( 'de-DE' )`, matching the pattern
already used by the sibling "default locale" and "locale and options"
tests in the same file, so the assertion no longer depends on which
ICU data is compiled into the runtime.

Ref: https://github.com/stdlib-js/stdlib/actions/runs/30532379700
@stdlib-bot

stdlib-bot commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

Coverage Report

Package Statements Branches Functions Lines
dstructs/named-typed-tuple $\\color{red}1103/1829$
$\\color{green}+0.00\\%$
$\\color{red}78/95$
$\\color{green}+0.00\\%$
$\\color{red}14/40$
$\\color{green}+0.00\\%$
$\\color{red}1103/1829$
$\\color{green}+0.00\\%$

The above coverage report was generated for the changes in this PR.

Signed-off-by: Athan <kgryte@gmail.com>
@kgryte
kgryte marked this pull request as ready for review July 30, 2026 22:23
@kgryte
kgryte requested a review from a team July 30, 2026 22:23
@stdlib-bot stdlib-bot added the Needs Review A pull request which needs code review. label Jul 30, 2026
@kgryte kgryte added Tests Pull requests specifically adding tests. and removed Needs Review A pull request which needs code review. labels Jul 30, 2026
@kgryte kgryte changed the title test(@stdlib/dstructs/named-typed-tuple): fix locale-specific toLocaleString assertion test: ensure backward compatibility in test assertion Jul 30, 2026
@kgryte
kgryte merged commit f9691b2 into develop Jul 30, 2026
49 checks passed
@kgryte
kgryte deleted the philipp/ci-fix-locale-tolocalestring-2026-07-30 branch July 30, 2026 22:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Tests Pull requests specifically adding tests.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants