File: m007.t

package info (click to toggle)
libdate-calc-xs-perl 6.4-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 812 kB
  • sloc: perl: 7,397; ansic: 2,607; makefile: 2
file content (45 lines) | stat: -rw-r--r-- 858 bytes parent folder | download | duplicates (9)
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::Calendar;
require Date::Calendar::Profiles;

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

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

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

$n = 1;

$year = 2000;

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

__END__