view release on metacpan or search on metacpan
inc/Test/Base.pm view on Meta::CPAN
$Text::Diff::VERSION >= 0.35 &&
$Algorithm::Diff::VERSION >= 1.15;
}
provides 'is';
sub is($$;$) {
(my ($self), @_) = find_my_self(@_);
my ($actual, $expected, $name) = @_;
local $Test::Builder::Level = $Test::Builder::Level + 1 unless $HAS_PROVIDER;
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
examples/tools.pl view on Meta::CPAN
use Test2 qw/context run_subtest/;
use Test2::Hub::Interceptor();
use Test2::Hub::Interceptor::Terminator();
sub ok($;$@) {
my ($bool, $name, @diag) = @_;
my $ctx = context();
$ctx->ok($bool, $name, \@diag);
$ctx->release;
return $bool ? 1 : 0;
}
sub is($$;$@) {
my ($got, $want, $name, @diag) = @_;
my $ctx = context();
my $bool;
if (defined($got) && defined($want)) {
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Test/Simpler.pm view on Meta::CPAN
# Export the module's interface...
our @EXPORT = ( 'ok' );
our @EXPORT_OK = ();
our %EXPORT_TAGS = ();
sub ok($;$) {
my $outcome = shift;
my $desc = @_ ? "@_" : undef;
# Grab the upscope variables...
my %value_for = ( %{peek_our(1)}, %{peek_my(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
lib/Test/Smoke/Database.pm view on Meta::CPAN
}
#------------------------------------------------------------------------------
# db
#------------------------------------------------------------------------------
sub db(\%) { return $_[0]->{DB}; }
#------------------------------------------------------------------------------
# HTML
#------------------------------------------------------------------------------
sub HTML(\%) { return $_[0]->{HTML}; }
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Test/Spec.pm view on Meta::CPAN
}
# it DESC => CODE
# it CODE
# it DESC
sub it(@) {
my $package = caller;
my $code;
if (@_ && ref($_[-1]) eq 'CODE') {
$code = pop;
}
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Test/Stream/Plugin/Classic.pm view on Meta::CPAN
use Test::Stream::Compare::String();
use Test::Stream::Compare::Pattern();
use Test::Stream::Plugin::Compare();
sub is($$;$@) {
my ($got, $exp, $name, @diag) = @_;
my $ctx = context();
my @caller = caller;
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/Test/WWW/Declare.pm view on Meta::CPAN
=head3 should(nt) (caselessly) equal STRING
=cut
# DSLey functions
sub to($) { return $_[0] }
sub _args {
my $args = shift;
return $args if ref($args) eq 'HASH';
return {expected => $args};
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Test2/Tools/Basic.pm view on Meta::CPAN
ok pass fail diag note todo skip
plan skip_all done_testing bail_out
};
use base 'Exporter';
sub ok($;$@) {
my ($bool, $name, @diag) = @_;
my $ctx = context();
$ctx->ok($bool, $name, \@diag);
$ctx->release;
return $bool ? 1 : 0;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Test2/Tools/HTTP.pm view on Meta::CPAN
)
);
}
sub _T()
{
my @caller = _caller;
Test2::Compare::Custom->new(
code => sub { $_ ? 1 : 0 },
name => 'TRUE',
lib/Test2/Tools/HTTP.pm view on Meta::CPAN
sub http_is_error { _add_call('is_error', _T()) }
sub http_is_client_error { _add_call('is_client_error', _T()) }
sub http_is_server_error { _add_call('is_server_error', _T()) }
sub _F()
{
my @caller = _caller;
Test2::Compare::Custom->new(
code => sub { $_ ? 0 : 1 },
name => 'TRUE',
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
t/outputs.t view on Meta::CPAN
use Text::Diff;
my @A = map "$_\n", qw( 1 2 3 4 );
my @B = map "$_\n", qw( 1 2 3 5 );
sub _d($) {
diff \@A, \@B, { OUTPUT => shift };
}
sub slurp {
open SLURP, "<$_[0]" or die $!;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Text/FIGlet/Control.pm view on Meta::CPAN
}
$self->{_sub} = eval "sub { local \$_ = shift; $code; return \$_ }";
bless($self);
}
sub tr($){
my $self = shift;
$self->{_sub}->( shift || $_ );
}
1;
__END__
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/Text/Patch/Rred.pm view on Meta::CPAN
C<@lines> was empty. Otherwise returns C<undef>.
=cut
## no critic (RequireArgUnpacking)
sub Do($;)
{
my $self = shift;
local $_ = undef;
my $ok = 1;
for (@_) {
view all matches for this distribution
view release on metacpan or search on metacpan
exit 0;
my $test_label;
sub t (&)
{
my($test_f) = @_;
$test_label = undef;
eval {&$test_f};
my $ok = $@ ? "not ok" : "ok";
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/Tie/Hash/Cache/MRU.pm view on Meta::CPAN
sub S(){6};
sub F(){7};
sub D(){8};
sub E(){9};
sub C(){10};
sub FK(){11};
sub NK(){12};
sub DE(){13};
sub TIEHASH {
my $pack = shift;
my %arg = @_;
view all matches for this distribution
view release on metacpan or search on metacpan
######################### End of black magic.
$hashref = Tie::InSecureHash->new();
$ok_count = 1;
sub ok($)
{
# print "\t$@" if $@ && $::VERBOSE;
# print "\tUnexpected error at ", (caller)[2], "\n"
# if !$_[0] && !$@ && $::VERBOSE;
# print "not " unless $_[0];
view all matches for this distribution
view release on metacpan or search on metacpan
print "1..6\n";
my $testno;
sub t ($) {
print "not " unless shift;
print "ok ",++$testno,"\n";
}
require Tie::OneOff;
view all matches for this distribution
view release on metacpan or search on metacpan
t/dangerous.t view on Meta::CPAN
######################### End of black magic.
$hashref = Tie::SecureHash->new();
$ok_count = 1;
sub ok($)
{
print "\t$@" if $@ && $::VERBOSE;
print "\tUnexpected error at ", (caller)[2], "\n"
if !$_[0] && !$@ && $::VERBOSE;
print "not " unless $_[0];
view all matches for this distribution
view release on metacpan or search on metacpan
sub match($$) {
my($a, $b) = @_;
ok ref($a) eq ref($b) && $a == $b;
}
sub br(@) { Math::BigRat->new(@_) }
eval { utc_day_to_cjdn(br("0.5")); };
like $@, qr/\Anon-integer day [^\t\n\f\r ]+ is invalid /;
eval { utc_cjdn_to_day(br("0.5")); };
view all matches for this distribution
view release on metacpan or search on metacpan
BEGIN { use_ok "Time::UTC_SLS", qw(utc_day_to_cjdn utc_cjdn_to_day); }
use Math::BigRat 0.04;
sub br(@) { Math::BigRat->new(@_) }
sub match($$) {
my($a, $b) = @_;
ok ref($a) eq ref($b) && $a == $b;
}
view all matches for this distribution
view release on metacpan or search on metacpan
$VERSION = '0.02';
$tally = 'a';
# use TipJar::fields qw/RA targetlist body/;
sub RA(){0};
sub targetlist(){1};
sub body(){2};
# humbug
# use Fcntl ':flock';
sub FLOCK_EX(){2};
view all matches for this distribution
view release on metacpan or search on metacpan
} else {
@copies;
}
}
sub cp(@) {
return copy @_;
}
# instantiate our object
sub new(@)
view all matches for this distribution