#!/usr/bin/perl -w
use
5.004;
plan
tests
=> 20;
BEGIN { MyTestHelpers::nowarnings(); }
{
my
$want_version
= 123;
ok (
$Math::PlanePath::PeanoCurve::VERSION
,
$want_version
,
'VERSION variable'
);
ok (Math::PlanePath::PeanoCurve->VERSION,
$want_version
,
'VERSION class method'
);
ok (
eval
{ Math::PlanePath::PeanoCurve->VERSION(
$want_version
); 1 },
1,
"VERSION class check $want_version"
);
my
$check_version
=
$want_version
+ 1000;
ok (!
eval
{ Math::PlanePath::PeanoCurve->VERSION(
$check_version
); 1 },
1,
"VERSION class check $check_version"
);
my
$path
= Math::PlanePath::PeanoCurve->new;
ok (
$path
->VERSION,
$want_version
,
'VERSION object method'
);
ok (
eval
{
$path
->VERSION(
$want_version
); 1 },
1,
"VERSION object check $want_version"
);
ok (!
eval
{
$path
->VERSION(
$check_version
); 1 },
1,
"VERSION object check $check_version"
);
}
{
my
$path
= Math::PlanePath::PeanoCurve->new;
ok (
$path
->n_start, 0,
'n_start()'
);
ok (
$path
->x_negative, 0,
'x_negative() instance method'
);
ok (
$path
->y_negative, 0,
'y_negative() instance method'
);
}
{
my
$path
= Math::PlanePath::PeanoCurve->new;
{
my
(
$n_lo
,
$n_hi
) =
$path
->level_to_n_range(0);
ok (
$n_lo
, 0);
ok (
$n_hi
, 0); }
{
my
(
$n_lo
,
$n_hi
) =
$path
->level_to_n_range(1);
ok (
$n_lo
, 0);
ok (
$n_hi
, 8); }
{
my
(
$n_lo
,
$n_hi
) =
$path
->level_to_n_range(2);
ok (
$n_lo
, 0);
ok (
$n_hi
, 80); }
}
{
my
$path
= Math::PlanePath::PeanoCurve->new (
radix
=> 5);
{
my
(
$n_lo
,
$n_hi
) =
$path
->level_to_n_range(0);
ok (
$n_lo
, 0);
ok (
$n_hi
, 0); }
{
my
(
$n_lo
,
$n_hi
) =
$path
->level_to_n_range(1);
ok (
$n_lo
, 0);
ok (
$n_hi
, 24); }
}
exit
0;