File: f019.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 (97 lines) | stat: -rw-r--r-- 2,607 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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
#!perl -w

use strict;
no strict "vars";

use Date::Pcalc qw( Days_in_Month );

# ======================================================================
#   $days = Days_in_Month($year,$mm);
# ======================================================================

print "1..26\n";

$n = 1;
eval { Days_in_Month(1964,0); };
if ($@ =~ /month out of range/)
{print "ok $n\n";} else {print "not ok $n\n";}
$n++;
if (Days_in_Month(1964,1) == 31)
{print "ok $n\n";} else {print "not ok $n\n";}
$n++;
if (Days_in_Month(1964,2) == 29)
{print "ok $n\n";} else {print "not ok $n\n";}
$n++;
if (Days_in_Month(1964,3) == 31)
{print "ok $n\n";} else {print "not ok $n\n";}
$n++;
if (Days_in_Month(1964,4) == 30)
{print "ok $n\n";} else {print "not ok $n\n";}
$n++;
if (Days_in_Month(1964,5) == 31)
{print "ok $n\n";} else {print "not ok $n\n";}
$n++;
if (Days_in_Month(1964,6) == 30)
{print "ok $n\n";} else {print "not ok $n\n";}
$n++;
if (Days_in_Month(1964,7) == 31)
{print "ok $n\n";} else {print "not ok $n\n";}
$n++;
if (Days_in_Month(1964,8) == 31)
{print "ok $n\n";} else {print "not ok $n\n";}
$n++;
if (Days_in_Month(1964,9) == 30)
{print "ok $n\n";} else {print "not ok $n\n";}
$n++;
if (Days_in_Month(1964,10) == 31)
{print "ok $n\n";} else {print "not ok $n\n";}
$n++;
if (Days_in_Month(1964,11) == 30)
{print "ok $n\n";} else {print "not ok $n\n";}
$n++;
if (Days_in_Month(1964,12) == 31)
{print "ok $n\n";} else {print "not ok $n\n";}
$n++;
eval { Days_in_Month(1995,0); };
if ($@ =~ /month out of range/)
{print "ok $n\n";} else {print "not ok $n\n";}
$n++;
if (Days_in_Month(1995,1) == 31)
{print "ok $n\n";} else {print "not ok $n\n";}
$n++;
if (Days_in_Month(1995,2) == 28)
{print "ok $n\n";} else {print "not ok $n\n";}
$n++;
if (Days_in_Month(1995,3) == 31)
{print "ok $n\n";} else {print "not ok $n\n";}
$n++;
if (Days_in_Month(1995,4) == 30)
{print "ok $n\n";} else {print "not ok $n\n";}
$n++;
if (Days_in_Month(1995,5) == 31)
{print "ok $n\n";} else {print "not ok $n\n";}
$n++;
if (Days_in_Month(1995,6) == 30)
{print "ok $n\n";} else {print "not ok $n\n";}
$n++;
if (Days_in_Month(1995,7) == 31)
{print "ok $n\n";} else {print "not ok $n\n";}
$n++;
if (Days_in_Month(1995,8) == 31)
{print "ok $n\n";} else {print "not ok $n\n";}
$n++;
if (Days_in_Month(1995,9) == 30)
{print "ok $n\n";} else {print "not ok $n\n";}
$n++;
if (Days_in_Month(1995,10) == 31)
{print "ok $n\n";} else {print "not ok $n\n";}
$n++;
if (Days_in_Month(1995,11) == 30)
{print "ok $n\n";} else {print "not ok $n\n";}
$n++;
if (Days_in_Month(1995,12) == 31)
{print "ok $n\n";} else {print "not ok $n\n";}
$n++;

__END__