File: m007.t

package info (click to toggle)
libdate-pcalc-perl 6.1-8
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,904 kB
  • sloc: perl: 16,706; ansic: 3,086; sh: 14; makefile: 5
file content (45 lines) | stat: -rw-r--r-- 864 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
42
43
44
45
#!perl -w

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

eval { require Bit::Vector; };

if ($@)
{
    print "1..0\n";
    exit 0;
}

require Date::Pcalendar;
require Date::Pcalendar::Profiles;

Date::Pcalendar::Profiles->import('$Profiles');

# ======================================================================
#   $cal  = Date::Pcalendar->new($prof);
#   $year = $cal->year($year);
#   $year = Date::Pcalendar::Year->new($year,$prof); # (implicitly)
# ======================================================================

print "1..", scalar(keys %{$Profiles}), "\n";

$n = 1;

$year = 2000;

foreach $key (keys %{$Profiles})
{
    eval
    {
        $cal  = Date::Pcalendar->new( $Profiles->{$key} );
        $year = $cal->year( $year );
    };
    unless ($@)
    {print "ok $n\n";} else {print "not ok $n\n";}
    $n++;
}

__END__