/Compress/ modules are at version 2.021. Remove vestigal MAPs and comments.
[p5sagit/p5-mst-13.2.git] / ext / Time-Piece / t / 02core.t
index d020558..5610bcb 100644 (file)
@@ -1,4 +1,4 @@
-use Test::More tests => 93;
+use Test::More tests => 95;
 
 my $is_win32 = ($^O =~ /Win32/);
 my $is_qnx = ($^O eq 'qnx');
@@ -47,6 +47,20 @@ cmp_ok($t->datetime, 'eq','2000-02-29T12:34:56');
 cmp_ok($t->daylight_savings, '==', 0);
 
 # ->tzoffset?
+my $is_pseudo_fork = 0;
+if (defined &Win32::GetCurrentProcessId
+    ? $$ != Win32::GetCurrentProcessId() : $^O eq "MSWin32" && $$ < 0) {
+    $is_pseudo_fork = 1;
+}
+SKIP: {
+    skip "can't register TZ changes in a pseudo-fork", 2 if $is_pseudo_fork;
+    local $ENV{TZ} = "EST5";
+    Time::Piece::_tzset();  # register the environment change
+    my $lt = localtime;
+    cmp_ok(scalar($lt->tzoffset), 'eq', '-18000');
+    cmp_ok($lt->strftime("%Z"), 'eq', 'EST');
+}
+
 cmp_ok(($t->julian_day / 2451604.0243 ) - 1, '<', 0.001);
 cmp_ok(($t->mjd        /   51603.52426) - 1, '<', 0.001);
 cmp_ok($t->week, '==', 9);