Skip to content

test(globalization): CultureInfo-invariance matrix over Try surface (#182) - #268

Merged
Chris-Wolfgang merged 1 commit into
vNextfrom
tier2/182-globalization
Jul 17, 2026
Merged

test(globalization): CultureInfo-invariance matrix over Try surface (#182)#268
Chris-Wolfgang merged 1 commit into
vNextfrom
tier2/182-globalization

Conversation

@Chris-Wolfgang

Copy link
Copy Markdown
Owner

Closes #182.

Summary

Adds GlobalizationInvarianceTests (net6+): 5 representative tests over the Try / Result surface, each run as a [Theory] with 6 CultureInfo rows — en-US, tr-TR, de-DE, zh-CN, ar-SA, ja-JP. Per test: swap CurrentCulture + CurrentUICulture, run body, restore in finally.

Allowlist

Empty. Try-Pattern doesn't format numbers/dates/collate/case-fold; its surface is culture-invariant by contract. Top-of-file comment documents this and requires new culture-sensitive methods to be added to the allowlist before merging.

Stacked-PR base

Base = vNext. Fifth of the 11-PR batch.

Local run

dotnet test -c Release -f net10.0 --filter FullyQualifiedName~Globalization30/30 pass (5 × 6) in 89 ms.

Test plan

  • All 30 rows green on this PR across net6.0/net7.0/net8.0/net9.0/net10.0 test-TFMs (guarded to net6+)

Closes #182.

Adds `GlobalizationInvarianceTests` (net6+) re-running a
representative slice of the Try / Result surface under every hostile
culture the fleet standard covers: en-US (baseline), tr-TR
(dotted-I), de-DE (decimal-comma), zh-CN (collation), ar-SA
(RTL + Hindi-Arabic digits), ja-JP (full-width digits).

Each test swaps BOTH `CurrentCulture` and `CurrentUICulture`,
executes the body, and restores in `finally` — a xunit parallelism
split cannot leak culture across unrelated tests. Covered:

  - Result.Success / Result.Failure identity + ErrorMessage
  - Try.Run(Action) carries exception message verbatim
  - Try.Run<T>(Func<T>) returns value unchanged
  - Try.RunAsync succeeds under hostile culture
  - Result.AllSucceeded / AnyFailed / Flatten identical output

Culture-sensitivity allowlist: EMPTY per top-of-file comment. If a
future method introduces culture-dependent behaviour, it must be
added there before merging and either excluded from the theory or
explicitly asserted against invariant output.

Local run: `dotnet test -f net10.0 --filter Globalization` → 30/30
pass (5 tests × 6 cultures) in 89 ms.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings July 16, 2026 00:17

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants