File: f009.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 (40 lines) | stat: -rw-r--r-- 1,284 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
#!perl -w

use strict;
no strict "vars";

use Date::Pcalc qw( Day_of_Week );

# ======================================================================
#   $weekday = Day_of_Week($year,$mm,$dd);
# ======================================================================

print "1..11\n";

$n = 1;
if (Day_of_Week(1964,1,3)   == 5) {print "ok $n\n";} else {print "not ok $n\n";}
$n++;
if (Day_of_Week(1995,11,13) == 1) {print "ok $n\n";} else {print "not ok $n\n";}
$n++;
if (Day_of_Week(1995,11,14) == 2) {print "ok $n\n";} else {print "not ok $n\n";}
$n++;
if (Day_of_Week(1995,11,15) == 3) {print "ok $n\n";} else {print "not ok $n\n";}
$n++;
if (Day_of_Week(1995,11,16) == 4) {print "ok $n\n";} else {print "not ok $n\n";}
$n++;
if (Day_of_Week(1995,11,17) == 5) {print "ok $n\n";} else {print "not ok $n\n";}
$n++;
if (Day_of_Week(1995,11,18) == 6) {print "ok $n\n";} else {print "not ok $n\n";}
$n++;
if (Day_of_Week(1995,11,19) == 7) {print "ok $n\n";} else {print "not ok $n\n";}
$n++;
if (Day_of_Week(1995,11,20) == 1) {print "ok $n\n";} else {print "not ok $n\n";}
$n++;
if (Day_of_Week(1995,2,28) == 2) {print "ok $n\n";} else {print "not ok $n\n";}
$n++;
eval { Day_of_Week(1995,2,29); };
if ($@ =~ /not a valid date/)
{print "ok $n\n";} else {print "not ok $n\n";}

__END__