Debian lenny version packages
[pkg-perl] / deb-src / libemail-date-format-perl / libemail-date-format-perl-1.002 / t / basic.t
diff --git a/deb-src/libemail-date-format-perl/libemail-date-format-perl-1.002/t/basic.t b/deb-src/libemail-date-format-perl/libemail-date-format-perl-1.002/t/basic.t
new file mode 100644 (file)
index 0000000..a38e0b9
--- /dev/null
@@ -0,0 +1,31 @@
+use Test::More tests => 3;
+use strict;
+$^W = 1;
+
+use Email::Date::Format qw(email_date email_gmdate);
+
+is(
+  length email_date, # no argument == now
+  (localtime)[3] > 9 ? 31 : 30, # Day > 9 means extra char in the string
+  "constant length",
+);
+
+my $birthday = 1153432704; # no, really!
+
+my $tz = sprintf "%s%02u%02u", Email::Date::Format::_tz_diff(1153432704);
+
+SKIP: {
+    skip "test only useful in US/Eastern, -0400, not $tz", 1 if $tz ne '-0400';
+
+    is(
+        email_date(1153432704),
+        'Thu, 20 Jul 2006 17:58:24 -0400',
+        "rjbs's birthday date format properly",
+    );
+}
+
+is(
+  email_gmdate(1153432704),
+  'Thu, 20 Jul 2006 21:58:24 +0000',
+  "rjbs's birthday date format properly in GMT",
+);