cpan/Test-Simple/t/Legacy/utf8.t
cpan/Test-Simple/t/Legacy/versions.t
cpan/Test-Simple/t/Legacy_And_Test2/builder_loaded_late.t
+cpan/Test-Simple/t/Legacy_And_Test2/diag_event_on_ok.t
cpan/Test-Simple/t/Legacy_And_Test2/hidden_warnings.t
cpan/Test-Simple/t/Legacy_And_Test2/preload_diag_note.t
cpan/Test-Simple/t/lib/Dev/Null.pm
},
'Test::Simple' => {
- 'DISTRIBUTION' => 'EXODIST/Test-Simple-1.302103.tar.gz',
+ 'DISTRIBUTION' => 'EXODIST/Test-Simple-1.302111.tar.gz',
'FILES' => q[cpan/Test-Simple],
'EXCLUDED' => [
qr{^examples/},
use strict;
use warnings;
-our $VERSION = '1.302103';
+our $VERSION = '1.302111';
BEGIN {
if( $] < 5.008 ) {
my (undef, $file, $line) = $trace->call;
if (defined $orig_name) {
- $self->diag(qq[ $msg test '$orig_name'\n]);
- $self->diag(qq[ at $file line $line.\n]);
+ $self->diag(qq[ $msg test '$orig_name'\n at $file line $line.\n]);
}
else {
$self->diag(qq[ $msg test at $file line $line.\n]);
use strict;
use warnings;
-our $VERSION = '1.302103';
+our $VERSION = '1.302111';
BEGIN { require Test2::Formatter::TAP; our @ISA = qw(Test2::Formatter::TAP) }
require Exporter;
our @ISA = qw(Exporter);
-our $VERSION = '1.302103';
+our $VERSION = '1.302111';
=head1 NAME
package Test::Builder::Tester;
use strict;
-our $VERSION = '1.302103';
+our $VERSION = '1.302111';
use Test::Builder;
use Symbol;
package Test::Builder::Tester::Color;
use strict;
-our $VERSION = '1.302103';
+our $VERSION = '1.302111';
require Test::Builder::Tester;
use strict;
use warnings;
-our $VERSION = '1.302103';
+our $VERSION = '1.302111';
BEGIN { require Test2::Event::Diag; our @ISA = qw(Test2::Event::Diag) }
return warn @_, " at $file line $line\n";
}
-our $VERSION = '1.302103';
+our $VERSION = '1.302111';
use Test::Builder::Module;
our @ISA = qw(Test::Builder::Module);
use strict;
-our $VERSION = '1.302103';
+our $VERSION = '1.302111';
use Test::Builder::Module;
our @ISA = qw(Test::Builder::Module);
{
if (*Test::Builder::new{CODE})
{
- warn "You should load Test::Tester before Test::Builder (or anything that loads Test::Builder)"
+ warn "You should load Test::Tester before Test::Builder (or anything that loads Test::Builder)"
}
}
use vars qw( @ISA @EXPORT );
-our $VERSION = '1.302103';
+our $VERSION = '1.302111';
@EXPORT = qw( run_tests check_tests check_test cmp_results show_space );
@ISA = qw( Exporter );
if (defined(my $exp = $expect->{diag}))
{
- # if there actually is some diag then put a \n on the end if it's not
- # there already
- $exp .= "\n" if (length($exp) and $exp !~ /\n$/);
- if (not $Test->ok($result->{diag} eq $exp,
- "subtest '$sub_name' of '$name' compare diag")
- )
- {
- my $got = $result->{diag};
- my $glen = length($got);
- my $elen = length($exp);
- for ($got, $exp)
- {
- my @lines = split("\n", $_);
- $_ = join("\n", map {
- if ($want_space)
- {
- $_ = $colour.escape($_).$reset;
- }
- else
- {
- "'$colour$_$reset'"
- }
- } @lines);
- }
-
- $Test->diag(<<EOM);
+ my $got = '';
+ if (ref $exp eq 'Regexp') {
+
+ if (not $Test->like($result->{diag}, $exp,
+ "subtest '$sub_name' of '$name' compare diag"))
+ {
+ $got = $result->{diag};
+ }
+
+ } else {
+
+ # if there actually is some diag then put a \n on the end if it's not
+ # there already
+ $exp .= "\n" if (length($exp) and $exp !~ /\n$/);
+
+ if (not $Test->ok($result->{diag} eq $exp,
+ "subtest '$sub_name' of '$name' compare diag"))
+ {
+ $got = $result->{diag};
+ }
+ }
+
+ if ($got) {
+ my $glen = length($got);
+ my $elen = length($exp);
+ for ($got, $exp)
+ {
+ my @lines = split("\n", $_);
+ $_ = join("\n", map {
+ if ($want_space)
+ {
+ $_ = $colour.escape($_).$reset;
+ }
+ else
+ {
+ "'$colour$_$reset'"
+ }
+ } @lines);
+ }
+
+ $Test->diag(<<EOM);
Got diag ($glen bytes):
$got
Expected diag ($elen bytes):
$exp
EOM
-
- }
+ }
}
}
or
+ use Test::Tester tests => 6;
+
+ use Test::MyStyle;
+
+ check_test(
+ sub {
+ is_mystyle_qr("this", "that", "not matching");
+ },
+ {
+ ok => 0, # expect this to fail
+ name => "not matching",
+ diag => qr/Expected: 'this'\s+Got: 'that'/,
+ }
+ );
+
+or
+
use Test::Tester;
use Test::More tests => 3;
like($result[0]->{diag}, "/^Database ping took \\d+ seconds$"/, "diag");
+or
+
+ check_test(
+ sub { is_mystyle_qr("this", "that", "not matching") },
+ {
+ ok => 0, # we expect the test to fail
+ name => "not matching",
+ diag => qr/Expected: 'this'\s+Got: 'that'/,
+ }
+ );
We cannot predict how long the database ping will take so we use
Test::More's like() test to check that the diagnostic string is of the right
package Test::Tester::Capture;
-our $VERSION = '1.302103';
+our $VERSION = '1.302111';
use Test::Builder;
package Test::Tester::CaptureRunner;
-our $VERSION = '1.302103';
+our $VERSION = '1.302111';
use Test::Tester::Capture;
package Test::Tester::Delegate;
-our $VERSION = '1.302103';
+our $VERSION = '1.302111';
use Scalar::Util();
package Test::use::ok;
use 5.005;
-our $VERSION = '1.302103';
+our $VERSION = '1.302111';
__END__
use strict;
use warnings;
-our $VERSION = '1.302103';
+our $VERSION = '1.302111';
1;
$ENV{TEST2_ACTIVE} = 1;
}
-our $VERSION = '1.302103';
+our $VERSION = '1.302111';
my $INST;
use strict;
use warnings;
-our $VERSION = '1.302103';
+our $VERSION = '1.302111';
use Test2::Util qw/pkg_to_file/;
use strict;
use warnings;
-our $VERSION = '1.302103';
+our $VERSION = '1.302111';
use Carp qw/confess croak/;
use strict;
use warnings;
-our $VERSION = '1.302103';
+our $VERSION = '1.302111';
our @CARP_NOT = qw/Test2::API Test2::API::Instance Test2::IPC::Driver Test2::Formatter/;
return $_[0]->{hub}->cull unless $self->{+IPC_SHM_ID};
my $val;
- {
- shmread($self->{+IPC_SHM_ID}, $val, 0, $self->{+IPC_SHM_SIZE}) or return;
-
+ if(shmread($self->{+IPC_SHM_ID}, $val, 0, $self->{+IPC_SHM_SIZE})) {
return if $val eq $self->{+IPC_SHM_LAST};
$self->{+IPC_SHM_LAST} = $val;
}
+ else {
+ warn "SHM Read error: $!\n";
+ }
$_[0]->{hub}->cull;
}
my $ipc_key = IPC::SysV::IPC_PRIVATE();
my $shm_size = $self->{+IPC}->can('shm_size') ? $self->{+IPC}->shm_size : 64;
- my $shm_id = shmget($ipc_key, $shm_size, 0666) or die;
+ my $shm_id = shmget($ipc_key, $shm_size, 0666) or die "Could not get shm: $!";
my $initial = 'a' x $shm_size;
- shmwrite($shm_id, $initial, 0, $shm_size) or die;
+ shmwrite($shm_id, $initial, 0, $shm_size) or die "Could not write to shm: $!";
+ my $val;
+ shmread($shm_id, $val, 0, $shm_size) or die "Could not read from shm: $!";
+ die "Read SHM value does not match the initial value ('$val' vs '$initial')"
+ unless $val eq $initial;
$self->{+IPC_SHM_SIZE} = $shm_size;
$self->{+IPC_SHM_ID} = $shm_id;
use strict;
use warnings;
-our $VERSION = '1.302103';
+our $VERSION = '1.302111';
use Test2::Hub();
use strict;
use warnings;
-our $VERSION = '1.302103';
+our $VERSION = '1.302111';
use Test2::Util::HashBase qw/trace -amnesty/;
use Test2::Util::ExternalMeta qw/meta get_meta set_meta delete_meta/;
use strict;
use warnings;
-our $VERSION = '1.302103';
+our $VERSION = '1.302111';
BEGIN { require Test2::Event; our @ISA = qw(Test2::Event) }
use strict;
use warnings;
-our $VERSION = '1.302103';
+our $VERSION = '1.302111';
BEGIN { require Test2::Event; our @ISA = qw(Test2::Event) }
use strict;
use warnings;
-our $VERSION = '1.302103';
+our $VERSION = '1.302111';
use Carp qw/croak/;
use strict;
use warnings;
-our $VERSION = '1.302103';
+our $VERSION = '1.302111';
BEGIN { require Test2::Event; our @ISA = qw(Test2::Event) }
use strict;
use warnings;
-our $VERSION = '1.302103';
+our $VERSION = '1.302111';
use Test2::EventFacet::Info;
use Carp qw/croak/;
use Scalar::Util qw/reftype/;
-our $VERSION = '1.302103';
+our $VERSION = '1.302111';
BEGIN { require Test2::Event; our @ISA = qw(Test2::Event) }
use Test2::Util::HashBase;
use strict;
use warnings;
-our $VERSION = '1.302103';
+our $VERSION = '1.302111';
BEGIN { require Test2::Event; our @ISA = qw(Test2::Event) }
use strict;
use warnings;
-our $VERSION = '1.302103';
+our $VERSION = '1.302111';
BEGIN { require Test2::Event; our @ISA = qw(Test2::Event) }
use strict;
use warnings;
-our $VERSION = '1.302103';
+our $VERSION = '1.302111';
use Test2::EventFacet::Info;
use strict;
use warnings;
-our $VERSION = '1.302103';
+our $VERSION = '1.302111';
BEGIN { require Test2::Event; our @ISA = qw(Test2::Event) }
use strict;
use warnings;
-our $VERSION = '1.302103';
+our $VERSION = '1.302111';
BEGIN { require Test2::Event::Ok; our @ISA = qw(Test2::Event::Ok) }
use strict;
use warnings;
-our $VERSION = '1.302103';
+our $VERSION = '1.302111';
BEGIN { require Test2::Event::Ok; our @ISA = qw(Test2::Event::Ok) }
use Test2::Util::HashBase qw{subevents buffered subtest_id};
use strict;
use warnings;
-our $VERSION = '1.302103';
+our $VERSION = '1.302111';
use Carp qw/croak/;
use strict;
use warnings;
-our $VERSION = '1.302103';
+our $VERSION = '1.302111';
BEGIN { require Test2::Event; our @ISA = qw(Test2::Event) }
use strict;
use warnings;
-our $VERSION = '1.302103';
+our $VERSION = '1.302111';
use Test2::Util::HashBase qw/-details/;
use Carp qw/croak/;
use strict;
use warnings;
-our $VERSION = '1.302103';
+our $VERSION = '1.302111';
BEGIN { require Test2::EventFacet; our @ISA = qw(Test2::EventFacet) }
use Test2::Util::HashBase qw{ -package -no_display };
use strict;
use warnings;
-our $VERSION = '1.302103';
+our $VERSION = '1.302111';
sub is_list { 1 }
use strict;
use warnings;
-our $VERSION = '1.302103';
+our $VERSION = '1.302111';
BEGIN { require Test2::EventFacet; our @ISA = qw(Test2::EventFacet) }
use Test2::Util::HashBase qw{ -pass -no_debug -number };
use strict;
use warnings;
-our $VERSION = '1.302103';
+our $VERSION = '1.302111';
BEGIN { require Test2::EventFacet; our @ISA = qw(Test2::EventFacet) }
use Test2::Util::HashBase qw{ -global -terminate -halt -has_callback -encoding };
use strict;
use warnings;
-our $VERSION = '1.302103';
+our $VERSION = '1.302111';
sub facet_key { 'errors' }
sub is_list { 1 }
use strict;
use warnings;
-our $VERSION = '1.302103';
+our $VERSION = '1.302111';
sub is_list { 1 }
use strict;
use warnings;
-our $VERSION = '1.302103';
+our $VERSION = '1.302111';
BEGIN { require Test2::EventFacet; our @ISA = qw(Test2::EventFacet) }
use vars qw/$AUTOLOAD/;
use strict;
use warnings;
-our $VERSION = '1.302103';
+our $VERSION = '1.302111';
use Carp qw/confess/;
use strict;
use warnings;
-our $VERSION = '1.302103';
+our $VERSION = '1.302111';
BEGIN { require Test2::EventFacet; our @ISA = qw(Test2::EventFacet) }
use Test2::Util::HashBase qw{ -count -skip -none };
use strict;
use warnings;
-our $VERSION = '1.302103';
+our $VERSION = '1.302111';
BEGIN { require Test2::EventFacet; our @ISA = qw(Test2::EventFacet) }
use strict;
use warnings;
-our $VERSION = '1.302103';
+our $VERSION = '1.302111';
my %ADDED;
use strict;
use warnings;
-our $VERSION = '1.302103';
+our $VERSION = '1.302111';
use Test2::Util qw/clone_io/;
use strict;
use warnings;
-our $VERSION = '1.302103';
+our $VERSION = '1.302111';
use Carp qw/carp croak confess/;
use strict;
use warnings;
-our $VERSION = '1.302103';
+our $VERSION = '1.302111';
use Test2::Hub::Interceptor::Terminator();
use strict;
use warnings;
-our $VERSION = '1.302103';
+our $VERSION = '1.302111';
1;
use strict;
use warnings;
-our $VERSION = '1.302103';
+our $VERSION = '1.302111';
BEGIN { require Test2::Hub; our @ISA = qw(Test2::Hub) }
use Test2::Util::HashBase qw/nested exit_code manual_skip_all/;
use strict;
use warnings;
-our $VERSION = '1.302103';
+our $VERSION = '1.302111';
use Test2::API::Instance;
use strict;
use warnings;
-our $VERSION = '1.302103';
+our $VERSION = '1.302111';
use Carp qw/confess/;
use strict;
use warnings;
-our $VERSION = '1.302103';
+our $VERSION = '1.302111';
BEGIN { require Test2::IPC::Driver; our @ISA = qw(Test2::IPC::Driver) }
use Test2::Hub::Interceptor();
use Test2::Hub::Interceptor::Terminator();
-our $VERSION = '1.302103';
+our $VERSION = '1.302111';
BEGIN { require Exporter; our @ISA = qw(Exporter) }
our @EXPORT = qw{
use strict;
use warnings;
-our $VERSION = '1.302103';
+our $VERSION = '1.302111';
use POSIX();
use Config qw/%Config/;
use strict;
use warnings;
-our $VERSION = '1.302103';
+our $VERSION = '1.302111';
use Carp qw/croak/;
use strict;
use warnings;
-our $VERSION = '1.302103';
+our $VERSION = '1.302111';
use Carp qw/croak confess/;
use Scalar::Util qw/blessed/;
use strict;
use warnings;
+our $VERSION = '1.302111';
+
#################################################################
# #
# This is a generated file! Do not modify this file directly! #
# Use hashbase_inc.pl script to regenerate this file. #
# The script is part of the Object::HashBase distribution. #
+# Note: You can modify the version number above this comment #
+# if needed, that is fine. #
# #
#################################################################
{
no warnings 'once';
- $Test2::Util::HashBase::VERSION = '0.005';
+ $Test2::Util::HashBase::HB_VERSION = '0.006';
*Test2::Util::HashBase::ATTR_SUBS = \%Object::HashBase::ATTR_SUBS;
*Test2::Util::HashBase::ATTR_LIST = \%Object::HashBase::ATTR_LIST;
*Test2::Util::HashBase::VERSION = \%Object::HashBase::VERSION;
my $into = caller;
# Make sure we list the OLDEST version used to create this class.
- $Test2::Util::HashBase::VERSION{$into} = $Test2::Util::HashBase::VERSION
- if !$Test2::Util::HashBase::VERSION{$into}
- || $Test2::Util::HashBase::VERSION{$into} > $Test2::Util::HashBase::VERSION;
+ my $ver = $Test2::Util::HashBase::HB_VERSION || $Test2::Util::HashBase::VERSION;
+ $Test2::Util::HashBase::VERSION{$into} = $ver if !$Test2::Util::HashBase::VERSION{$into} || $Test2::Util::HashBase::VERSION{$into} > $ver;
my $isa = _isa($into);
my $attr_list = $Test2::Util::HashBase::ATTR_LIST{$into} ||= [];
require Test2::EventFacet::Trace;
@ISA = ('Test2::EventFacet::Trace');
-our $VERSION = '1.302103';
+our $VERSION = '1.302111';
1;
package ok;
-our $VERSION = '1.302103';
+our $VERSION = '1.302111';
use strict;
use Test::More ();
#!/usr/bin/perl -w
+# HARNESS-NO-STREAM
BEGIN {
if( $ENV{PERL_CORE} ) {
#!/usr/bin/perl -w
+# HARNESS-NO-STREAM
BEGIN {
if( $ENV{PERL_CORE} ) {
use Test::Builder;
+# HARNESS-NO-STREAM
BEGIN {
if( $ENV{PERL_CORE} ) {
#!/usr/bin/perl -w
+# HARNESS-NO-STREAM
# Test Test::Builder->reset;
use Test::More;
use strict;
use warnings;
+# HARNESS-NO-STREAM
# See https://github.com/Test-More/test-more/issues/789
my $file = File::Spec->join(dirname(__FILE__), 'tbt_09do_script.pl');
$file = File::Spec->catfile(File::Spec->curdir(), $file)
- unless File::Spec->file_name_is_absolute($file);
+ unless File::Spec->file_name_is_absolute($file);
my $done = do $file;
ok(defined($done), 'do succeeded') or do {
if ($@) {
#!/usr/bin/perl
+# HARNESS-NO-STREAM
BEGIN {
if( $ENV{PERL_CORE} ) {
use Data::Dumper qw(Dumper);
my $test = Test::Builder->new;
-$test->plan(tests => 105);
+$test->plan(tests => 139);
my $cap;
depth => 0,
},
],
+ [
+ 'pass diag qr',
+ '$cap->ok(1, "pass diag qr");
+ $cap->diag("pass diag qr");',
+ {
+ name => "pass diag qr",
+ ok => 1,
+ actual_ok => 1,
+ reason => "",
+ type => "",
+ diag => qr/pass diag qr/,
+ depth => 0,
+ },
+ ],
+ [
+ 'fail diag qr',
+ '$cap->ok(0, "fail diag qr");
+ $cap->diag("fail diag qr");',
+ {
+ name => "fail diag qr",
+ ok => 0,
+ actual_ok => 0,
+ reason => "",
+ type => "",
+ diag => qr/fail diag qr/,
+ depth => 0,
+ },
+ ],
);
my $big_code = "";
#!/usr/bin/perl -w
+# HARNESS-NO-STREAM
# Can't use Test.pm, that's a 5.005 thing.
package My::Test;
#!/usr/bin/perl -w
+# HARNESS-NO-FORK
BEGIN {
if( $ENV{PERL_CORE} ) {
--- /dev/null
+use strict;
+use warnings;
+
+use Test2::Tools::Tiny;
+use Test2::API qw/intercept/;
+use Test::More ();
+
+my $events = intercept {
+ Test::More::ok(0, 'name');
+};
+
+my ($ok, $diag) = @$events;
+
+ok($ok->isa('Test2::Event::Ok'), "got 'ok' result");
+is($ok->pass, 0, "'ok' test failed");
+is($ok->name, 'name', "got 'ok' name");
+
+ok($diag->isa('Test2::Event::Diag'), "got 'ok' result");
+is($diag->message, " Failed test 'name'\n at $0 line 9.\n", "got all diag message in one diag event");
+
+done_testing;
use strict;
use warnings;
-BEGIN {
- eval { require threads; };
-}
+# The things done in this test can trigger a buggy return value on some
+# platforms. This prevents that. The harness should catch actual failures. If
+# no harness is active then we will NOT sanitize the exit value, false fails ar
+# ebetter than false passes.
+END { $? = 0 if $ENV{HARNESS_ACTIVE} }
+
+BEGIN { local ($@, $?, $!); eval { require threads } }
use Test2::Tools::Tiny;
use Test2::Util qw/CAN_THREAD CAN_REALLY_FORK/;
use Test2::IPC;
use Test2::API qw/test2_ipc_set_timeout test2_ipc_get_timeout/;
+my $plan = 2;
+$plan += 2 if CAN_REALLY_FORK;
+$plan += 2 if CAN_THREAD;
+plan $plan;
+
is(test2_ipc_get_timeout(), 30, "got default timeout");
test2_ipc_set_timeout(10);
is(test2_ipc_get_timeout(), 10, "hanged the timeout");
close($tpiper);
close($tpipew);
}
-
-done_testing;
is($one->formatter, 'Test2::Formatter::TAP', "got specified formatter");
ok($one->finalized, "calling format finalized the object");
- local $ENV{T2_FORMATTER} = '+Fake';
+ local $ENV{T2_FORMATTER} = '+A::Fake::Module::That::Should::Not::Exist';
$one->reset;
like(
exception { $one->formatter },
- qr/COULD NOT LOAD FORMATTER 'Fake' \(set by the 'T2_FORMATTER' environment variable\)/,
+ qr/COULD NOT LOAD FORMATTER 'A::Fake::Module::That::Should::Not::Exist' \(set by the 'T2_FORMATTER' environment variable\)/,
"Bad formatter"
);
}
(which is bundled with Compress-Raw-Zlib), L<Compress::Raw::Zlib> has been
upgraded to CPAN version 2.075.
+=item *
+
+L<Test::Simple> has been upgraded from version 1.302103 to 1.302111.
+
=back
=head2 Removed Modules and Pragmata