view release on metacpan or search on metacpan
t/compat/base/headers-etag.t view on Meta::CPAN
use APR::HTTP::Headers::Compat;
use HTTP::Headers::ETag;
my $Pool = APR::Pool->new;
sub mk(@) {
my $table = APR::Table::make( $Pool, 10 );
return APR::HTTP::Headers::Compat->new( $table, @_ );
}
my $h = mk;
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Test/Base.pm view on Meta::CPAN
eval { require Text::Diff; 1 } &&
$Text::Diff::VERSION >= 0.35 &&
$Algorithm::Diff::VERSION >= 1.15;
}
sub is($$;$) {
(my ($self), @_) = find_my_self(@_);
my ($actual, $expected, $name) = @_;
local $Test::Builder::Level = $Test::Builder::Level + 1;
if ($ENV{TEST_SHOW_NO_DIFFS} or
not defined $actual or
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Test/Base.pm view on Meta::CPAN
eval { require Text::Diff; 1 } &&
$Text::Diff::VERSION >= 0.35 &&
$Algorithm::Diff::VERSION >= 1.15;
}
sub is($$;$) {
(my ($self), @_) = find_my_self(@_);
my ($actual, $expected, $name) = @_;
local $Test::Builder::Level = $Test::Builder::Level + 1;
if ($ENV{TEST_SHOW_NO_DIFFS} or
not defined $actual or
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Test/Base.pm view on Meta::CPAN
eval { require Text::Diff; 1 } &&
$Text::Diff::VERSION >= 0.35 &&
$Algorithm::Diff::VERSION >= 1.15;
}
sub is($$;$) {
(my ($self), @_) = find_my_self(@_);
my ($actual, $expected, $name) = @_;
local $Test::Builder::Level = $Test::Builder::Level + 1;
if ($ENV{TEST_SHOW_NO_DIFFS} or
not defined $actual or
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Test/Base.pm view on Meta::CPAN
eval { require Text::Diff; 1 } &&
$Text::Diff::VERSION >= 0.35 &&
$Algorithm::Diff::VERSION >= 1.15;
}
sub is($$;$) {
(my ($self), @_) = find_my_self(@_);
my ($actual, $expected, $name) = @_;
local $Test::Builder::Level = $Test::Builder::Level + 1;
if ($ENV{TEST_SHOW_NO_DIFFS} or
not defined $actual or
view all matches for this distribution
view release on metacpan or search on metacpan
CramCode.pm view on Meta::CPAN
use Compress::Zlib;
our $VERSION = '0.01';
$birthmark ="Oh, I'm crammed, baby!!";
sub encode($){$birthmark. compress shift}
sub decode($){uncompress shift}
sub bm($){$_[0]=~/^$birthmark/s}
open 0 or print "Can't open '$0'\n" and exit;
(my $code=join q//, <0>)=~s/.*^\s*use\s+Acme::CramCode\s*;\n//sm;
do {$code=~s/^$birthmark//;eval decode $code; exit} if bm $code;
open 0, ">$0" or print "Cannot encode '$0'\n" and exit;
print {0} "use Acme::CramCode;\n", encode $code and exit;
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Test/Base.pm view on Meta::CPAN
eval { require Text::Diff; 1 } &&
$Text::Diff::VERSION >= 0.35 &&
$Algorithm::Diff::VERSION >= 1.15;
}
sub is($$;$) {
(my ($self), @_) = find_my_self(@_);
my ($actual, $expected, $name) = @_;
local $Test::Builder::Level = $Test::Builder::Level + 1;
if ($ENV{TEST_SHOW_NO_DIFFS} or
not defined $actual or
view all matches for this distribution
view release on metacpan or search on metacpan
t/descartes.t view on Meta::CPAN
BEGIN { $^W= 1; }
use Test qw( plan );
my $ok;
sub ok($;$$) {
for( &Test::ok(@_) ) {
$ok= 0
if ! $_;
return $_;
}
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Test/Base.pm view on Meta::CPAN
eval { require Text::Diff; 1 } &&
$Text::Diff::VERSION >= 0.35 &&
$Algorithm::Diff::VERSION >= 1.15;
}
sub is($$;$) {
(my ($self), @_) = find_my_self(@_);
my ($actual, $expected, $name) = @_;
local $Test::Builder::Level = $Test::Builder::Level + 1;
if ($ENV{TEST_SHOW_NO_DIFFS} or
not defined $actual or
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Test/Base.pm view on Meta::CPAN
eval { require Text::Diff; 1 } &&
$Text::Diff::VERSION >= 0.35 &&
$Algorithm::Diff::VERSION >= 1.15;
}
sub is($$;$) {
(my ($self), @_) = find_my_self(@_);
my ($actual, $expected, $name) = @_;
local $Test::Builder::Level = $Test::Builder::Level + 1;
if ($ENV{TEST_SHOW_NO_DIFFS} or
not defined $actual or
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Test/Base.pm view on Meta::CPAN
eval { require Text::Diff; 1 } &&
$Text::Diff::VERSION >= 0.35 &&
$Algorithm::Diff::VERSION >= 1.15;
}
sub is($$;$) {
(my ($self), @_) = find_my_self(@_);
my ($actual, $expected, $name) = @_;
local $Test::Builder::Level = $Test::Builder::Level + 1;
if ($ENV{TEST_SHOW_NO_DIFFS} or
not defined $actual or
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Acme/Test/42.pm view on Meta::CPAN
our @ISA = qw(Test::Builder::Module);
our @EXPORT = qw(ok not_ok);
my $CLASS = __PACKAGE__;
sub ok($;$) {
return $CLASS->builder->ok($_[0] eq 42, $_[1]);
}
sub not_ok($;$) {
return $CLASS->builder->ok($_[0] ne 42, $_[1]);
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Aion/Format.pm view on Meta::CPAN
%properties = %{_extends_ddp_properties(\%properties)};
DDP::p $arg, %properties
}
# np Ñ Ð¿ÑедÑÑÑановленнÑми опÑиÑми
sub np($;%) {
my ($arg, %properties) = @_;
%properties = %{_extends_ddp_properties(\%properties)};
DDP::np $arg, %properties
}
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Aion/Types.pm view on Meta::CPAN
$type->make($pkg)
}
}
}
sub as(@) { (as => @_) }
sub init_where(&@) { (init_where => @_) }
sub where(&@) { (where => @_) }
sub awhere(&@) { (awhere => @_) }
sub message(&@) { (message => @_) }
view all matches for this distribution
view release on metacpan or search on metacpan
$DB::single = 1;
warn @_;
};
}
sub Ok($$) { @_= reverse @_; goto &ok }
my( $first, $a, $b, $hunks );
for my $pair (
[ "a b c e h j l m n p",
" b c d e f j k l m r s t", 9 ],
view all matches for this distribution
view release on metacpan or search on metacpan
$DB::single = 1;
warn @_;
};
}
sub Ok($$) { @_= reverse @_; goto &ok }
my( $first, $a, $b, $hunks );
for my $pair (
[ "a b c e h j l m n p",
" b c d e f j k l m r s t", 9 ],
view all matches for this distribution
view release on metacpan or search on metacpan
$DB::single = 1;
warn @_;
};
}
sub Ok($$) { @_= reverse @_; goto &ok }
my( $first, $a, $b, $hunks );
for my $pair (
[ "a b c e h j l m n p",
" b c d e f j k l m r s t", 9 ],
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Test/Base.pm view on Meta::CPAN
eval { require Text::Diff; 1 } &&
$Text::Diff::VERSION >= 0.35 &&
$Algorithm::Diff::VERSION >= 1.15;
}
sub is($$;$) {
(my ($self), @_) = find_my_self(@_);
my ($actual, $expected, $name) = @_;
local $Test::Builder::Level = $Test::Builder::Level + 1;
if ($ENV{TEST_SHOW_NO_DIFFS} or
not defined $actual or
view all matches for this distribution
view release on metacpan or search on metacpan
t/00_load.t view on Meta::CPAN
my $fec = new Algorithm::FEC 3, 5, 70;
my $test = 0;
sub ok($) {
$test++;
print $_[0] ? "ok $test\n" : "not ok $test\n";
}
my @files = map {
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Ambrosia/DataProvider/BaseDriver.pm view on Meta::CPAN
sub PREDICATE() { 6 }
sub LIMIT() { 7 }
sub ORDER_BY() { 8 }
sub NO_QUOTE() { 9 }
sub JOIN() { 10 }
sub ON() { 11 }
sub UNIQ() { 12 }
sub UNION() { 13 }
#####################
sub get_what { $_[0]->_cql_query->[&WHAT] }
sub get_select { $_[0]->_cql_query->[&SELECT] }
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Test/Base.pm view on Meta::CPAN
eval { require Text::Diff; 1 } &&
$Text::Diff::VERSION >= 0.35 &&
$Algorithm::Diff::VERSION >= 1.15;
}
sub is($$;$) {
(my ($self), @_) = find_my_self(@_);
my ($actual, $expected, $name) = @_;
local $Test::Builder::Level = $Test::Builder::Level + 1;
if ($ENV{TEST_SHOW_NO_DIFFS} or
not defined $actual or
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Test/Base.pm view on Meta::CPAN
eval { require Text::Diff; 1 } &&
$Text::Diff::VERSION >= 0.35 &&
$Algorithm::Diff::VERSION >= 1.15;
}
sub is($$;$) {
(my ($self), @_) = find_my_self(@_);
my ($actual, $expected, $name) = @_;
local $Test::Builder::Level = $Test::Builder::Level + 1;
if ($ENV{TEST_SHOW_NO_DIFFS} or
not defined $actual or
view all matches for this distribution
view release on metacpan or search on metacpan
lib/AnyEvent/Callback.pm view on Meta::CPAN
my $new_cb = $cb->CB(sub { ... }, sub { ... }); # the same
=cut
sub CB(&;&) {
my $parent;
my ($cb, $ecb) = @_;
($parent, $cb, $ecb) = @_ unless 'CODE' eq ref $cb;
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Test/Base.pm view on Meta::CPAN
eval { require Text::Diff; 1 } &&
$Text::Diff::VERSION >= 0.35 &&
$Algorithm::Diff::VERSION >= 1.15;
}
sub is($$;$) {
(my ($self), @_) = find_my_self(@_);
my ($actual, $expected, $name) = @_;
local $Test::Builder::Level = $Test::Builder::Level + 1;
if ($ENV{TEST_SHOW_NO_DIFFS} or
not defined $actual or
view all matches for this distribution
view release on metacpan or search on metacpan
t/04_flush.t view on Meta::CPAN
print "1..10\n";
use AnyEvent::Fork;
use AnyEvent::Fork::RPC;
sub ok($;$) {
print $_[0] ? "" : "not ", "ok ", ++$::ok, " # $_[1]\n";
}
ok 1;
view all matches for this distribution
view release on metacpan or search on metacpan
Quite the same as the same method of L<AnyEvent::Fork>.
=cut
# quote a binary string as a perl scalar
sub sq($) {
my $s = shift;
$s =~ /'/
or return "'$s'";
$s =~ s/(\x10+)/\x10.'$1'.q\x10/g;
"q\x10$s\x10"
}
# quote a list of strings
sub aq(@) {
"(" . (join ",", map sq $_, @_) . ")"
}
sub eval {
my ($self, $perlcode, @args) = @_;
view all matches for this distribution
view release on metacpan or search on metacpan
# the empty template process
our $TEMPLATE;
sub QUEUE() { 0 }
sub FH() { 1 }
sub WW() { 2 }
sub PID() { 3 }
sub CB() { 4 }
sub _new {
my ($self, $fh, $pid) = @_;
AnyEvent::Util::fh_nonblocking $fh, 1;
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Test/Base.pm view on Meta::CPAN
eval { require Text::Diff; 1 } &&
$Text::Diff::VERSION >= 0.35 &&
$Algorithm::Diff::VERSION >= 1.15;
}
sub is($$;$) {
(my ($self), @_) = find_my_self(@_);
my ($actual, $expected, $name) = @_;
local $Test::Builder::Level = $Test::Builder::Level + 1;
if ($ENV{TEST_SHOW_NO_DIFFS} or
not defined $actual or
view all matches for this distribution
view release on metacpan or search on metacpan
}
}
}
}
sub _q($) {
return $_[0]
if $_[0] =~ /^[A-Za-z0-9_]+$/; # we are a lot more strict than the spec
local $_ = shift;
utf8::encode $_; # just in case
view all matches for this distribution
view release on metacpan or search on metacpan
lib/AnyEvent/DNS.pm view on Meta::CPAN
resolver->resolve ($domain => "aaaa", sub {
$cb->(map $_->[4], @_);
});
}
sub mx($$) {
my ($domain, $cb) = @_;
resolver->resolve ($domain => "mx", sub {
$cb->(map $_->[5], sort { $a->[4] <=> $b->[4] } @_);
});
}
sub ns($$) {
my ($domain, $cb) = @_;
resolver->resolve ($domain => "ns", sub {
$cb->(map $_->[4], @_);
});
view all matches for this distribution