File: f030.t

package info (click to toggle)
libdate-pcalc-perl 1.2-3
  • links: PTS, VCS
  • area: main
  • in suites: lenny
  • size: 428 kB
  • ctags: 80
  • sloc: perl: 4,738; makefile: 42; sh: 18
file content (53 lines) | stat: -rw-r--r-- 1,453 bytes parent folder | download | duplicates (2)
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#!perl -w

use strict;
no strict "vars";

use Date::Pcalc qw( Parse_Date );

# ======================================================================
#   ($year,$mm,$dd) = Parse_Date($date);
# ======================================================================

print "1..8\n";

$n = 1;
unless (($year,$mm,$dd) = Parse_Date(""))
{print "ok $n\n";} else {print "not ok $n\n";}
$n++;

if ((($year,$mm,$dd) = Parse_Date("Sat Dec  2 00:10:10 1995")) &&
($year==1995) && ($mm==12) && ($dd==2))
{print "ok $n\n";} else {print "not ok $n\n";}
$n++;

if ((($year,$mm,$dd) = Parse_Date("Tue Jan 04 16:31:59 1996")) &&
($year==1996) && ($mm==1) && ($dd==4))
{print "ok $n\n";} else {print "not ok $n\n";}
$n++;

if ((($year,$mm,$dd) = Parse_Date("Sun Feb 16 00:01:13 GMT+0100 1997")) &&
($year==1997) && ($mm==2) && ($dd==16))
{print "ok $n\n";} else {print "not ok $n\n";}
$n++;

if ((($year,$mm,$dd) = Parse_Date("Jane 1997 Feb 16 birthday")) &&
($year==1997) && ($mm==2) && ($dd==16))
{print "ok $n\n";} else {print "not ok $n\n";}
$n++;

if ((($year,$mm,$dd) = Parse_Date("Jan 1997 Feb 16 birthday")) &&
($year==1997) && ($mm==2) && ($dd==16))
{print "ok $n\n";} else {print "not ok $n\n";}
$n++;

unless (($year,$mm,$dd) = Parse_Date("Tue Jan 04 16:31:59 1896"))
{print "ok $n\n";} else {print "not ok $n\n";}
$n++;

unless (($year,$mm,$dd) = Parse_Date("Sun Feb 29 00:01:13 GMT+0100 1997"))
{print "ok $n\n";} else {print "not ok $n\n";}
$n++;

__END__