Debian lenny version packages
[pkg-perl] / deb-src / libemail-date-format-perl / libemail-date-format-perl-1.002 / t / basic.t
1 use Test::More tests => 3;
2 use strict;
3 $^W = 1;
4
5 use Email::Date::Format qw(email_date email_gmdate);
6
7 is(
8   length email_date, # no argument == now
9   (localtime)[3] > 9 ? 31 : 30, # Day > 9 means extra char in the string
10   "constant length",
11 );
12
13 my $birthday = 1153432704; # no, really!
14
15 my $tz = sprintf "%s%02u%02u", Email::Date::Format::_tz_diff(1153432704);
16
17 SKIP: {
18     skip "test only useful in US/Eastern, -0400, not $tz", 1 if $tz ne '-0400';
19
20     is(
21         email_date(1153432704),
22         'Thu, 20 Jul 2006 17:58:24 -0400',
23         "rjbs's birthday date format properly",
24     );
25 }
26
27 is(
28   email_gmdate(1153432704),
29   'Thu, 20 Jul 2006 21:58:24 +0000',
30   "rjbs's birthday date format properly in GMT",
31 );