use
lib
qw!Regex-Number-GtLt/lib!
;
BEGIN { use_ok(
'Regex::Number::GtLt'
) };
my
$ok
=1;
for
my
$i
(1..1000){
my
$gre
= Regex::Number::GtLt::rxgreater(4,
$i
);
for
(
map
sprintf
(
'%04d'
,
$_
), 0 ..
$i
){
$ok
= 0
if
/
$gre
/;
}
for
(
map
sprintf
(
'%04d'
,
$_
),
$i
+1 .. 1000){
$ok
= 0
if
!/
$gre
/;
}
}
ok(
$ok
== 1,
'rxgreater'
);
$ok
=1;
for
my
$i
(1..1000){
my
$lre
= Regex::Number::GtLt::rxsmaller(4,
$i
);
for
(
map
sprintf
(
'%04d'
,
$_
), 0 ..
$i
-1){
$ok
= 0
if
!/
$lre
/;
}
for
(
map
sprintf
(
'%04d'
,
$_
),
$i
+1 .. 1000){
$ok
= 0
if
/
$lre
/;
}
}
ok(
$ok
== 1,
'rxsmaller'
);