[go: up one dir, main page]

File: f002.t

package info (click to toggle)
libdate-calc-perl 6.3-2
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 1,272 kB
  • ctags: 339
  • sloc: perl: 14,844; makefile: 2
file content (41 lines) | stat: -rw-r--r-- 1,303 bytes parent folder | download | duplicates (5)
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
#!perl -w

BEGIN { eval { require bytes; }; }
use strict;
no strict "vars";

BEGIN { $Date::Calc::XS_DISABLE = $Date::Calc::XS_DISABLE = 1; }

use Date::Calc qw( check_date );

# ======================================================================
#   $flag = check_date($year,$mm,$dd);
# ======================================================================

print "1..11\n";

$n = 1;
if (check_date(1,1,1) == 1) {print "ok $n\n";} else {print "not ok $n\n";}
$n++;
if (check_date(0,1,1) == 0) {print "ok $n\n";} else {print "not ok $n\n";}
$n++;
if (check_date(1,0,1) == 0) {print "ok $n\n";} else {print "not ok $n\n";}
$n++;
if (check_date(1,1,0) == 0) {print "ok $n\n";} else {print "not ok $n\n";}
$n++;
if (check_date(-1,1,1) == 0) {print "ok $n\n";} else {print "not ok $n\n";}
$n++;
if (check_date(1,-1,1) == 0) {print "ok $n\n";} else {print "not ok $n\n";}
$n++;
if (check_date(1,1,-1) == 0) {print "ok $n\n";} else {print "not ok $n\n";}
$n++;
if (check_date(1964,1,3)  == 1) {print "ok $n\n";} else {print "not ok $n\n";}
$n++;
if (check_date(1964,2,29) == 1) {print "ok $n\n";} else {print "not ok $n\n";}
$n++;
if (check_date(1995,2,28) == 1) {print "ok $n\n";} else {print "not ok $n\n";}
$n++;
if (check_date(1995,2,29) == 0) {print "ok $n\n";} else {print "not ok $n\n";}

__END__