Test-HTTP

 view release on metacpan or  search on metacpan

lib/Test/HTTP.pm  view on Meta::CPAN

60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
 
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

106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
sub _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 )