Debian Codegraph @

t/order1.t

raw
1 #!/usr/bin/perl -I. -w
2
3 use strict;
4 use warnings;
5 use Test::More;
6 use Time::ParseDate;
7 #use POSIX qw(tzset);
8 use Time::Piece;
9
10 my $finished;
11 END { ok($finished, 'finished') if defined $finished }
12
13 $ENV{'LANG'} = 'C';
14 $ENV{'TZ'} = 'PST8PDT';
15
16 my @x = localtime(785307957);
17 my @y = gmtime(785307957);
18 my $hd = $y[2] - $x[2];
19 $hd += 24 if $hd < 0;
20 $hd %= 24;
21 if ($hd != 8) {
22 plan skip_all => "It seems localtime() does not honor \$ENV{TZ} when set in the test script. Please set the TZ environment variable to PST8PDT and rerun.";
23 exit 0;
24 }
25 plan qw(no_plan);
26
27 $finished = 0;
28
29 is(parsedate('1918/2/18'), -1636819200, "year 1918");
30 is(parsedate('2009/7/7'), 1246950000, "year 2009");
31
32 $ENV{'TZ'} = 'Europe/Moscow';
33 is(parsedate('2009-11-01'), 1257022800, 'Europe/Moscow, DST permanent 2009');
34 is(parsedate('2013-05-30'), 1369857600, 'Europe/Moscow, DST permanent 2013');
35
36 $finished = 1;
37