Commit e85ae66
committed
fix: Make get_thousands_separator_uncached truly bypass locale cache
The test helper function get_thousands_separator_uncached() was calling
get_numeric_locale() which uses OnceLock for permanent caching. This
caused tests to fail intermittently on Ubuntu when test execution order
varied, as the first test would cache its locale value and subsequent
tests would receive that cached value instead of reading fresh env vars.
Changes:
- Made get_locale_from_env() pub(crate) in i18n/mod.rs
- Updated get_thousands_separator_uncached() to call get_locale_from_env()
directly instead of the cached get_numeric_locale()
This ensures tests can properly change LC_NUMERIC environment variables
and see the effects immediately without cache interference.
Fixes Ubuntu test failures in:
- test_get_thousands_separator (line 423)
- test_format_with_thousands_separator_locale (line 383)1 parent c6cb13e commit e85ae66
2 files changed
Lines changed: 9 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
149 | 149 | | |
150 | 150 | | |
151 | 151 | | |
152 | | - | |
153 | | - | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
154 | 155 | | |
155 | 156 | | |
156 | 157 | | |
| |||
371 | 372 | | |
372 | 373 | | |
373 | 374 | | |
374 | | - | |
| 375 | + | |
375 | 376 | | |
376 | 377 | | |
377 | 378 | | |
378 | | - | |
| 379 | + | |
379 | 380 | | |
380 | 381 | | |
381 | 382 | | |
| |||
416 | 417 | | |
417 | 418 | | |
418 | 419 | | |
419 | | - | |
| 420 | + | |
420 | 421 | | |
421 | 422 | | |
422 | 423 | | |
423 | | - | |
| 424 | + | |
424 | 425 | | |
425 | 426 | | |
426 | 427 | | |
| |||
435 | 436 | | |
436 | 437 | | |
437 | 438 | | |
438 | | - | |
| 439 | + | |
439 | 440 | | |
440 | 441 | | |
441 | 442 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
32 | | - | |
| 32 | + | |
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
| |||
0 commit comments