Test-HTTP
view release on metacpan or search on metacpan
lib/Test/HTTP.pm view on Meta::CPAN
606162636465666768697071727374757677787980use
HTTP::Request;
use
Test::Builder;
our
$Builder
= Test::Builder->new;
our
$BasicPassword
;
our
$BasicUsername
;
our
$UaClass
=
'LWP::UserAgent'
;
our
$TODO
=
undef
;
our
@EXPORT
=
qw($TODO)
;
sub
_partition(&@);
sub
import
{
my
$class
=
shift
;
$Builder
->exported_to(
scalar
caller
);
my
(
$syntax
,
$nargs
) = _partition {
$_
eq
'-syntax'
}
@_
;
$Builder
->plan(
@$nargs
);
# WARNING: This only exports the stuff in @EXPORT.
lib/Test/HTTP.pm view on Meta::CPAN
106107108109110111112113114115116117118119120121122123124125sub
_initiliaze {
my
(
$self
,
$name
) =
@_
;
$self
->name(
$name
);
}
# Given a predicate and a list, return two listrefs. The elements in the
# first listref satisfy the predicate, and those in the second do not. The
# predicate acts on a localized value of $_ rather than any arguments to it.
sub
_partition(&@) {
my
(
$pred
,
@l
) =
@_
;
my
(
$tl
,
$fl
) = ( [], [] );
push
@{
&$pred
?
$tl
:
$fl
},
$_
for
@l
;
return
(
$tl
,
$fl
);
}
=head1 OBJECT FIELDS
( run in 0.295 second using v1.01-cache-2.11-cpan-cba739cd03b )