Commit Graph

6 Commits

Author SHA1 Message Date
Livia Medeiros
edcc542996
test: improve observable ICU behaviour coverage
PR-URL: https://github.com/nodejs/node/pull/42683
Refs: https://github.com/nodejs/node/issues/42440
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
2022-05-05 12:49:20 +01:00
Khaidi Chu
b35ee26f03
test: fix test-process-env-tz.js by using RegExp
Not all environment returns 'Central European Summer Time', 'British
Summer Time' and 'Coordinated Universal Time'. E.g. Some environment
like Chinese returns '中欧夏令时间', '英国夏令时间' and '协调世界时'.

PR-URL: https://github.com/nodejs/node/pull/42113
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Mestery <mestery@protonmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Akhil Marsonya <akhil.marsonya27@gmail.com>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
2022-03-04 11:48:33 +00:00
Ben Noordhuis
2bb93e1108 test: set LC_ALL to known good value
Set the locale to a known good value because it affects ICU's date
string formatting. Setting LC_ALL needs to happen before the first
call to `icu::Locale::getDefault()` because ICU caches the result.

Fixes: https://github.com/nodejs/node/issues/27856

PR-URL: https://github.com/nodejs/node/pull/28096
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Vladimir de Turckheim <vlad2t@hotmail.com>
2019-06-25 10:37:27 -07:00
Ben Noordhuis
eba348b6ae src: make process.env.TZ setter clear tz cache
Since the presence of the libc and V8 timezone caches seem to be
a perennial source of confusion to users ("why doesn't it work?!"),
let's try to support that pattern by intercepting assignments to
the TZ environment variable and reset the caches as a side effect.

Fixes: https://github.com/nodejs/node/issues/19974
PR-URL: https://github.com/nodejs/node/pull/20026
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Steven R Loomis <srloomis@us.ibm.com>
Reviewed-By: Timothy Gu <timothygu99@gmail.com>
2019-05-23 11:34:17 +02:00
Ruben Bridgewater
e767aa1a2e
Revert "src: make process.env.TZ setter clear tz cache"
This reverts commit 1d1ab76e17.

PR-URL: https://github.com/nodejs/node/pull/20228
Fixes: https://github.com/nodejs/node/issues/20227
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2018-04-23 23:39:30 +02:00
Ben Noordhuis
1d1ab76e17
src: make process.env.TZ setter clear tz cache
Since the presence of the libc and V8 timezone caches seem to be
a perennial source of confusion to users ("why doesn't it work?!"),
let's try to support that pattern by intercepting assignments to
the `TZ` environment variable and reset the caches as a side effect.

PR-URL: https://github.com/nodejs/node/pull/20026
Fixes: https://github.com/nodejs/node/issues/19974
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2018-04-23 15:53:10 +02:00