File: parse-strict.t

package info (click to toggle)
libdatetime-format-mail-perl 0.4030-3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 1,176 kB
  • sloc: perl: 395; makefile: 2
file content (25 lines) | stat: -rw-r--r-- 528 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
use strict;
use Test::More tests => 4;

use DateTime::Format::Mail;


my $f = DateTime::Format::Mail->new();

while (<DATA>)
{
    chomp;
    my ($s, $e) = split /\s*\t\s*/, $_;
    $e ||= $s;

    my $p = $f->format_datetime($f->parse_datetime($s));
    is $p => $e, $s;
}



__DATA__
Wed, 12 Mar 2003 03:22:58 MDT	Wed, 12 Mar 2003 03:22:58 -0600
Wed, 12 Mar 03 03:22:58 -0500	Wed, 12 Mar 2003 03:22:58 -0500
01 Feb 2002 16:06:38 -0500	Fri,  1 Feb 2002 16:06:38 -0500
01 Dec 2002 05:53:06 +0800	Sun,  1 Dec 2002 05:53:06 +0800