summaryrefslogtreecommitdiff
path: root/cpan/Test-Simple
diff options
context:
space:
mode:
authorSteve Hay <steve.m.hay@googlemail.com>2016-10-13 08:29:16 +0100
committerSteve Hay <steve.m.hay@googlemail.com>2016-10-13 08:29:16 +0100
commit061828b3b8df6f38383ada8703fd195cd2f6ef74 (patch)
tree736eab434c066af139016bd08b58855119013c3b /cpan/Test-Simple
parent39250dd4375e1aed90b8a926fd4c0e343b83a4d8 (diff)
downloadperl-061828b3b8df6f38383ada8703fd195cd2f6ef74.tar.gz
Upgrade Test::Simple from version 1.302056 to 1.302059
Diffstat (limited to 'cpan/Test-Simple')
-rw-r--r--cpan/Test-Simple/lib/Test/Builder.pm7
-rw-r--r--cpan/Test-Simple/lib/Test/Builder/Formatter.pm2
-rw-r--r--cpan/Test-Simple/lib/Test/Builder/Module.pm2
-rw-r--r--cpan/Test-Simple/lib/Test/Builder/Tester.pm11
-rw-r--r--cpan/Test-Simple/lib/Test/Builder/Tester/Color.pm2
-rw-r--r--cpan/Test-Simple/lib/Test/Builder/TodoDiag.pm2
-rw-r--r--cpan/Test-Simple/lib/Test/More.pm6
-rw-r--r--cpan/Test-Simple/lib/Test/Simple.pm2
-rw-r--r--cpan/Test-Simple/lib/Test/Tester.pm5
-rw-r--r--cpan/Test-Simple/lib/Test/Tester/Capture.pm2
-rw-r--r--cpan/Test-Simple/lib/Test/Tester/CaptureRunner.pm2
-rw-r--r--cpan/Test-Simple/lib/Test/Tester/Delegate.pm2
-rw-r--r--cpan/Test-Simple/lib/Test/use/ok.pm2
-rw-r--r--cpan/Test-Simple/lib/Test2.pm2
-rw-r--r--cpan/Test-Simple/lib/Test2/API.pm10
-rw-r--r--cpan/Test-Simple/lib/Test2/API/Breakage.pm2
-rw-r--r--cpan/Test-Simple/lib/Test2/API/Context.pm15
-rw-r--r--cpan/Test-Simple/lib/Test2/API/Instance.pm2
-rw-r--r--cpan/Test-Simple/lib/Test2/API/Stack.pm2
-rw-r--r--cpan/Test-Simple/lib/Test2/Event.pm2
-rw-r--r--cpan/Test-Simple/lib/Test2/Event/Bail.pm2
-rw-r--r--cpan/Test-Simple/lib/Test2/Event/Diag.pm2
-rw-r--r--cpan/Test-Simple/lib/Test2/Event/Exception.pm2
-rw-r--r--cpan/Test-Simple/lib/Test2/Event/Generic.pm2
-rw-r--r--cpan/Test-Simple/lib/Test2/Event/Info.pm2
-rw-r--r--cpan/Test-Simple/lib/Test2/Event/Note.pm2
-rw-r--r--cpan/Test-Simple/lib/Test2/Event/Ok.pm2
-rw-r--r--cpan/Test-Simple/lib/Test2/Event/Plan.pm2
-rw-r--r--cpan/Test-Simple/lib/Test2/Event/Skip.pm2
-rw-r--r--cpan/Test-Simple/lib/Test2/Event/Subtest.pm2
-rw-r--r--cpan/Test-Simple/lib/Test2/Event/Waiting.pm2
-rw-r--r--cpan/Test-Simple/lib/Test2/Formatter.pm2
-rw-r--r--cpan/Test-Simple/lib/Test2/Formatter/TAP.pm2
-rw-r--r--cpan/Test-Simple/lib/Test2/Hub.pm2
-rw-r--r--cpan/Test-Simple/lib/Test2/Hub/Interceptor.pm2
-rw-r--r--cpan/Test-Simple/lib/Test2/Hub/Interceptor/Terminator.pm2
-rw-r--r--cpan/Test-Simple/lib/Test2/Hub/Subtest.pm2
-rw-r--r--cpan/Test-Simple/lib/Test2/IPC.pm2
-rw-r--r--cpan/Test-Simple/lib/Test2/IPC/Driver.pm2
-rw-r--r--cpan/Test-Simple/lib/Test2/IPC/Driver/Files.pm2
-rw-r--r--cpan/Test-Simple/lib/Test2/Util.pm2
-rw-r--r--cpan/Test-Simple/lib/Test2/Util/ExternalMeta.pm2
-rw-r--r--cpan/Test-Simple/lib/Test2/Util/HashBase.pm2
-rw-r--r--cpan/Test-Simple/lib/Test2/Util/Trace.pm2
-rw-r--r--cpan/Test-Simple/lib/ok.pm2
-rw-r--r--cpan/Test-Simple/t/Legacy/is_deeply_fail.t10
-rw-r--r--cpan/Test-Simple/t/Test2/behavior/special_names.t32
-rw-r--r--cpan/Test-Simple/t/Test2/legacy/TAP.t32
-rw-r--r--cpan/Test-Simple/t/Test2/modules/IPC/Driver/Files.t20
-rw-r--r--cpan/Test-Simple/t/regression/721-nested-streamed-subtest.t96
-rw-r--r--cpan/Test-Simple/t/tools.pl34
51 files changed, 224 insertions, 132 deletions
diff --git a/cpan/Test-Simple/lib/Test/Builder.pm b/cpan/Test-Simple/lib/Test/Builder.pm
index f0e7598747..d3febbc9d1 100644
--- a/cpan/Test-Simple/lib/Test/Builder.pm
+++ b/cpan/Test-Simple/lib/Test/Builder.pm
@@ -4,7 +4,7 @@ use 5.006;
use strict;
use warnings;
-our $VERSION = '1.302056';
+our $VERSION = '1.302059';
BEGIN {
if( $] < 5.008 ) {
@@ -197,6 +197,7 @@ sub child {
$meta->{Test_Results} = [];
$meta->{subevents} = $subevents;
$meta->{subtest_id} = $hub->id;
+ $meta->{subtest_buffered} = $parent->format ? 0 : 1;
$self->_add_ts_hooks;
@@ -269,6 +270,7 @@ FAIL
else {
$parent->{subevents} = $meta->{subevents};
$parent->{subtest_id} = $meta->{subtest_id};
+ $parent->{subtest_buffered} = $meta->{subtest_buffered};
$parent->ok( $chub->is_passing, $meta->{Name} );
}
}
@@ -627,10 +629,11 @@ sub ok {
my @attrs;
my $subevents = delete $self->{subevents};
my $subtest_id = delete $self->{subtest_id};
+ my $subtest_buffered = delete $self->{subtest_buffered};
my $epkg = 'Test2::Event::Ok';
if ($subevents) {
$epkg = 'Test2::Event::Subtest';
- push @attrs => (subevents => $subevents, subtest_id => $subtest_id);
+ push @attrs => (subevents => $subevents, subtest_id => $subtest_id, buffered => $subtest_buffered);
}
my $e = bless {
diff --git a/cpan/Test-Simple/lib/Test/Builder/Formatter.pm b/cpan/Test-Simple/lib/Test/Builder/Formatter.pm
index 83ee55ff5c..8aa7e2c371 100644
--- a/cpan/Test-Simple/lib/Test/Builder/Formatter.pm
+++ b/cpan/Test-Simple/lib/Test/Builder/Formatter.pm
@@ -2,7 +2,7 @@ package Test::Builder::Formatter;
use strict;
use warnings;
-our $VERSION = '1.302056';
+our $VERSION = '1.302059';
BEGIN { require Test2::Formatter::TAP; our @ISA = qw(Test2::Formatter::TAP) }
diff --git a/cpan/Test-Simple/lib/Test/Builder/Module.pm b/cpan/Test-Simple/lib/Test/Builder/Module.pm
index 354ff5886f..fe35da62ea 100644
--- a/cpan/Test-Simple/lib/Test/Builder/Module.pm
+++ b/cpan/Test-Simple/lib/Test/Builder/Module.pm
@@ -7,7 +7,7 @@ use Test::Builder;
require Exporter;
our @ISA = qw(Exporter);
-our $VERSION = '1.302056';
+our $VERSION = '1.302059';
=head1 NAME
diff --git a/cpan/Test-Simple/lib/Test/Builder/Tester.pm b/cpan/Test-Simple/lib/Test/Builder/Tester.pm
index c4ea80c75b..716d521ec9 100644
--- a/cpan/Test-Simple/lib/Test/Builder/Tester.pm
+++ b/cpan/Test-Simple/lib/Test/Builder/Tester.pm
@@ -1,7 +1,7 @@
package Test::Builder::Tester;
use strict;
-our $VERSION = '1.302056';
+our $VERSION = '1.302059';
use Test::Builder;
use Symbol;
@@ -450,11 +450,12 @@ tests than we strictly should have and it'll register any failures we
had that we were testing for as real failures.
The color function doesn't work unless L<Term::ANSIColor> is
-compatible with your terminal.
+compatible with your terminal. Additionally, L<Win32::Console::ANSI>
+must be installed on windows platforms for color output.
Bugs (and requests for new features) can be reported to the author
-though the CPAN RT system:
-L<http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Test-Builder-Tester>
+though GitHub:
+L<https://github.com/Test-More/test-more/issues>
=head1 AUTHOR
@@ -560,6 +561,8 @@ sub complaint {
# get color
eval { require Term::ANSIColor };
unless($@) {
+ eval { require Win32::Console::ANSI } if 'MSWin32' eq $^O; # support color on windows platforms
+
# colours
my $green = Term::ANSIColor::color("black") . Term::ANSIColor::color("on_green");
diff --git a/cpan/Test-Simple/lib/Test/Builder/Tester/Color.pm b/cpan/Test-Simple/lib/Test/Builder/Tester/Color.pm
index a83edca68f..4ab8670871 100644
--- a/cpan/Test-Simple/lib/Test/Builder/Tester/Color.pm
+++ b/cpan/Test-Simple/lib/Test/Builder/Tester/Color.pm
@@ -1,7 +1,7 @@
package Test::Builder::Tester::Color;
use strict;
-our $VERSION = '1.302056';
+our $VERSION = '1.302059';
require Test::Builder::Tester;
diff --git a/cpan/Test-Simple/lib/Test/Builder/TodoDiag.pm b/cpan/Test-Simple/lib/Test/Builder/TodoDiag.pm
index 632e3fad20..7da9339139 100644
--- a/cpan/Test-Simple/lib/Test/Builder/TodoDiag.pm
+++ b/cpan/Test-Simple/lib/Test/Builder/TodoDiag.pm
@@ -2,7 +2,7 @@ package Test::Builder::TodoDiag;
use strict;
use warnings;
-our $VERSION = '1.302056';
+our $VERSION = '1.302059';
BEGIN { require Test2::Event::Diag; our @ISA = qw(Test2::Event::Diag) }
diff --git a/cpan/Test-Simple/lib/Test/More.pm b/cpan/Test-Simple/lib/Test/More.pm
index 3705a916bd..623987757e 100644
--- a/cpan/Test-Simple/lib/Test/More.pm
+++ b/cpan/Test-Simple/lib/Test/More.pm
@@ -17,7 +17,7 @@ sub _carp {
return warn @_, " at $file line $line\n";
}
-our $VERSION = '1.302056';
+our $VERSION = '1.302059';
use Test::Builder::Module;
our @ISA = qw(Test::Builder::Module);
@@ -1184,7 +1184,7 @@ sub _type {
return '' if !ref $thing;
- for my $type (qw(Regexp ARRAY HASH REF SCALAR GLOB CODE)) {
+ for my $type (qw(Regexp ARRAY HASH REF SCALAR GLOB CODE VSTRING)) {
return $type if UNIVERSAL::isa( $thing, $type );
}
@@ -1976,7 +1976,7 @@ the perl-qa gang.
=head1 BUGS
-See F<http://rt.cpan.org> to report and view bugs.
+See F<https://github.com/Test-More/test-more/issues> to report and view bugs.
=head1 SOURCE
diff --git a/cpan/Test-Simple/lib/Test/Simple.pm b/cpan/Test-Simple/lib/Test/Simple.pm
index 3ff4c227e5..b0261f8793 100644
--- a/cpan/Test-Simple/lib/Test/Simple.pm
+++ b/cpan/Test-Simple/lib/Test/Simple.pm
@@ -4,7 +4,7 @@ use 5.006;
use strict;
-our $VERSION = '1.302056';
+our $VERSION = '1.302059';
use Test::Builder::Module;
our @ISA = qw(Test::Builder::Module);
diff --git a/cpan/Test-Simple/lib/Test/Tester.pm b/cpan/Test-Simple/lib/Test/Tester.pm
index 68780b741e..96c42e1f74 100644
--- a/cpan/Test-Simple/lib/Test/Tester.pm
+++ b/cpan/Test-Simple/lib/Test/Tester.pm
@@ -18,7 +18,7 @@ require Exporter;
use vars qw( @ISA @EXPORT );
-our $VERSION = '1.302056';
+our $VERSION = '1.302059';
@EXPORT = qw( run_tests check_tests check_test cmp_results show_space );
@ISA = qw( Exporter );
@@ -42,8 +42,9 @@ my $reset = '';
if (my $want_colour = $ENV{TESTTESTERCOLOUR} || $ENV{TESTTESTERCOLOR})
{
- if (eval "require Term::ANSIColor")
+ if (eval { require Term::ANSIColor; 1 })
{
+ eval { require Win32::Console::ANSI } if 'MSWin32' eq $^O; # support color on windows platforms
my ($f, $b) = split(",", $want_colour);
$colour = Term::ANSIColor::color($f).Term::ANSIColor::color("on_$b");
$reset = Term::ANSIColor::color("reset");
diff --git a/cpan/Test-Simple/lib/Test/Tester/Capture.pm b/cpan/Test-Simple/lib/Test/Tester/Capture.pm
index 6a169d6c2f..eeb0d2aabd 100644
--- a/cpan/Test-Simple/lib/Test/Tester/Capture.pm
+++ b/cpan/Test-Simple/lib/Test/Tester/Capture.pm
@@ -2,7 +2,7 @@ use strict;
package Test::Tester::Capture;
-our $VERSION = '1.302056';
+our $VERSION = '1.302059';
use Test::Builder;
diff --git a/cpan/Test-Simple/lib/Test/Tester/CaptureRunner.pm b/cpan/Test-Simple/lib/Test/Tester/CaptureRunner.pm
index 22eace0f13..d768b9bd82 100644
--- a/cpan/Test-Simple/lib/Test/Tester/CaptureRunner.pm
+++ b/cpan/Test-Simple/lib/Test/Tester/CaptureRunner.pm
@@ -3,7 +3,7 @@ use strict;
package Test::Tester::CaptureRunner;
-our $VERSION = '1.302056';
+our $VERSION = '1.302059';
use Test::Tester::Capture;
diff --git a/cpan/Test-Simple/lib/Test/Tester/Delegate.pm b/cpan/Test-Simple/lib/Test/Tester/Delegate.pm
index 13b798b673..91cee4c23c 100644
--- a/cpan/Test-Simple/lib/Test/Tester/Delegate.pm
+++ b/cpan/Test-Simple/lib/Test/Tester/Delegate.pm
@@ -3,7 +3,7 @@ use warnings;
package Test::Tester::Delegate;
-our $VERSION = '1.302056';
+our $VERSION = '1.302059';
use vars '$AUTOLOAD';
diff --git a/cpan/Test-Simple/lib/Test/use/ok.pm b/cpan/Test-Simple/lib/Test/use/ok.pm
index dd5fcef9f4..5d0591fafa 100644
--- a/cpan/Test-Simple/lib/Test/use/ok.pm
+++ b/cpan/Test-Simple/lib/Test/use/ok.pm
@@ -1,7 +1,7 @@
package Test::use::ok;
use 5.005;
-our $VERSION = '1.302056';
+our $VERSION = '1.302059';
__END__
diff --git a/cpan/Test-Simple/lib/Test2.pm b/cpan/Test-Simple/lib/Test2.pm
index 85a1ee318e..29f8411e64 100644
--- a/cpan/Test-Simple/lib/Test2.pm
+++ b/cpan/Test-Simple/lib/Test2.pm
@@ -2,7 +2,7 @@ package Test2;
use strict;
use warnings;
-our $VERSION = '1.302056';
+our $VERSION = '1.302059';
1;
diff --git a/cpan/Test-Simple/lib/Test2/API.pm b/cpan/Test-Simple/lib/Test2/API.pm
index 118d7e623e..ba25944c66 100644
--- a/cpan/Test-Simple/lib/Test2/API.pm
+++ b/cpan/Test-Simple/lib/Test2/API.pm
@@ -2,7 +2,7 @@ package Test2::API;
use strict;
use warnings;
-our $VERSION = '1.302056';
+our $VERSION = '1.302059';
my $INST;
@@ -447,6 +447,14 @@ sub run_subtest {
$hub->format(undef) if $hide;
}
}
+ elsif (! $parent->format) {
+ # If our parent has no format that means we're in a buffered subtest
+ # and now we're trying to run a streaming subtest. There's really no
+ # way for that to work, so we need to force the use of a buffered
+ # subtest here as
+ # well. https://github.com/Test-More/test-more/issues/721
+ $buffered = 1;
+ }
if ($inherit_trace) {
my $orig = $code;
diff --git a/cpan/Test-Simple/lib/Test2/API/Breakage.pm b/cpan/Test-Simple/lib/Test2/API/Breakage.pm
index 0569bc9448..7b21ccadc1 100644
--- a/cpan/Test-Simple/lib/Test2/API/Breakage.pm
+++ b/cpan/Test-Simple/lib/Test2/API/Breakage.pm
@@ -2,7 +2,7 @@ package Test2::API::Breakage;
use strict;
use warnings;
-our $VERSION = '1.302056';
+our $VERSION = '1.302059';
use Test2::Util qw/pkg_to_file/;
diff --git a/cpan/Test-Simple/lib/Test2/API/Context.pm b/cpan/Test-Simple/lib/Test2/API/Context.pm
index a83560e0b6..c4e1ece69e 100644
--- a/cpan/Test-Simple/lib/Test2/API/Context.pm
+++ b/cpan/Test-Simple/lib/Test2/API/Context.pm
@@ -2,7 +2,7 @@ package Test2::API::Context;
use strict;
use warnings;
-our $VERSION = '1.302056';
+our $VERSION = '1.302059';
use Carp qw/confess croak longmess/;
@@ -66,9 +66,13 @@ sub DESTROY {
# Do not show the warning if it looks like an exception has been thrown, or
# if the context is not local to this process or thread.
- if($self->{+EVAL_ERROR} eq $@ && $hub->is_local) {
- my $frame = $self->{+_IS_SPAWN} || $self->{+TRACE}->frame;
- warn <<" EOT";
+ {
+ # Sometimes $@ is uninitialized, not a problem in this case so do not
+ # show the warning about using eq.
+ no warnings 'uninitialized';
+ if($self->{+EVAL_ERROR} eq $@ && $hub->is_local) {
+ my $frame = $self->{+_IS_SPAWN} || $self->{+TRACE}->frame;
+ warn <<" EOT";
A context appears to have been destroyed without first calling release().
Based on \$@ it does not look like an exception was thrown (this is not always
a reliable test)
@@ -84,7 +88,8 @@ release():
Tool: $frame->[3]
Cleaning up the CONTEXT stack...
- EOT
+ EOT
+ }
}
return if $self->{+_IS_SPAWN};
diff --git a/cpan/Test-Simple/lib/Test2/API/Instance.pm b/cpan/Test-Simple/lib/Test2/API/Instance.pm
index 1b41c66acb..556cad1f4b 100644
--- a/cpan/Test-Simple/lib/Test2/API/Instance.pm
+++ b/cpan/Test-Simple/lib/Test2/API/Instance.pm
@@ -2,7 +2,7 @@ package Test2::API::Instance;
use strict;
use warnings;
-our $VERSION = '1.302056';
+our $VERSION = '1.302059';
our @CARP_NOT = qw/Test2::API Test2::API::Instance Test2::IPC::Driver Test2::Formatter/;
diff --git a/cpan/Test-Simple/lib/Test2/API/Stack.pm b/cpan/Test-Simple/lib/Test2/API/Stack.pm
index 89fe2ebe1b..6db9f57fe8 100644
--- a/cpan/Test-Simple/lib/Test2/API/Stack.pm
+++ b/cpan/Test-Simple/lib/Test2/API/Stack.pm
@@ -2,7 +2,7 @@ package Test2::API::Stack;
use strict;
use warnings;
-our $VERSION = '1.302056';
+our $VERSION = '1.302059';
use Test2::Hub();
diff --git a/cpan/Test-Simple/lib/Test2/Event.pm b/cpan/Test-Simple/lib/Test2/Event.pm
index 5f3427be09..a0aa61923c 100644
--- a/cpan/Test-Simple/lib/Test2/Event.pm
+++ b/cpan/Test-Simple/lib/Test2/Event.pm
@@ -2,7 +2,7 @@ package Test2::Event;
use strict;
use warnings;
-our $VERSION = '1.302056';
+our $VERSION = '1.302059';
use Test2::Util::HashBase qw/trace nested in_subtest subtest_id/;
diff --git a/cpan/Test-Simple/lib/Test2/Event/Bail.pm b/cpan/Test-Simple/lib/Test2/Event/Bail.pm
index 9523a785a3..06c94ce951 100644
--- a/cpan/Test-Simple/lib/Test2/Event/Bail.pm
+++ b/cpan/Test-Simple/lib/Test2/Event/Bail.pm
@@ -2,7 +2,7 @@ package Test2::Event::Bail;
use strict;
use warnings;
-our $VERSION = '1.302056';
+our $VERSION = '1.302059';
BEGIN { require Test2::Event; our @ISA = qw(Test2::Event) }
diff --git a/cpan/Test-Simple/lib/Test2/Event/Diag.pm b/cpan/Test-Simple/lib/Test2/Event/Diag.pm
index a1339a4e44..08b8621b1b 100644
--- a/cpan/Test-Simple/lib/Test2/Event/Diag.pm
+++ b/cpan/Test-Simple/lib/Test2/Event/Diag.pm
@@ -2,7 +2,7 @@ package Test2::Event::Diag;
use strict;
use warnings;
-our $VERSION = '1.302056';
+our $VERSION = '1.302059';
BEGIN { require Test2::Event; our @ISA = qw(Test2::Event) }
diff --git a/cpan/Test-Simple/lib/Test2/Event/Exception.pm b/cpan/Test-Simple/lib/Test2/Event/Exception.pm
index 3e3b020567..4f7c7c59ca 100644
--- a/cpan/Test-Simple/lib/Test2/Event/Exception.pm
+++ b/cpan/Test-Simple/lib/Test2/Event/Exception.pm
@@ -2,7 +2,7 @@ package Test2::Event::Exception;
use strict;
use warnings;
-our $VERSION = '1.302056';
+our $VERSION = '1.302059';
BEGIN { require Test2::Event; our @ISA = qw(Test2::Event) }
diff --git a/cpan/Test-Simple/lib/Test2/Event/Generic.pm b/cpan/Test-Simple/lib/Test2/Event/Generic.pm
index 64187f4d18..ff47ced6b1 100644
--- a/cpan/Test-Simple/lib/Test2/Event/Generic.pm
+++ b/cpan/Test-Simple/lib/Test2/Event/Generic.pm
@@ -5,7 +5,7 @@ use warnings;
use Carp qw/croak/;
use Scalar::Util qw/reftype/;
-our $VERSION = '1.302056';
+our $VERSION = '1.302059';
BEGIN { require Test2::Event; our @ISA = qw(Test2::Event) }
use Test2::Util::HashBase;
diff --git a/cpan/Test-Simple/lib/Test2/Event/Info.pm b/cpan/Test-Simple/lib/Test2/Event/Info.pm
index 6446b38a6b..7b1db5f4b3 100644
--- a/cpan/Test-Simple/lib/Test2/Event/Info.pm
+++ b/cpan/Test-Simple/lib/Test2/Event/Info.pm
@@ -4,7 +4,7 @@ use warnings;
use Scalar::Util qw/blessed/;
-our $VERSION = '1.302056';
+our $VERSION = '1.302059';
BEGIN { require Test2::Event; our @ISA = qw(Test2::Event) }
use Test2::Util::HashBase qw/diagnostics renderer/;
diff --git a/cpan/Test-Simple/lib/Test2/Event/Note.pm b/cpan/Test-Simple/lib/Test2/Event/Note.pm
index 03f5bd0c8d..d0df97d729 100644
--- a/cpan/Test-Simple/lib/Test2/Event/Note.pm
+++ b/cpan/Test-Simple/lib/Test2/Event/Note.pm
@@ -2,7 +2,7 @@ package Test2::Event::Note;
use strict;
use warnings;
-our $VERSION = '1.302056';
+our $VERSION = '1.302059';
BEGIN { require Test2::Event; our @ISA = qw(Test2::Event) }
diff --git a/cpan/Test-Simple/lib/Test2/Event/Ok.pm b/cpan/Test-Simple/lib/Test2/Event/Ok.pm
index b9dab95775..d0cf32f6bb 100644
--- a/cpan/Test-Simple/lib/Test2/Event/Ok.pm
+++ b/cpan/Test-Simple/lib/Test2/Event/Ok.pm
@@ -2,7 +2,7 @@ package Test2::Event::Ok;
use strict;
use warnings;
-our $VERSION = '1.302056';
+our $VERSION = '1.302059';
BEGIN { require Test2::Event; our @ISA = qw(Test2::Event) }
diff --git a/cpan/Test-Simple/lib/Test2/Event/Plan.pm b/cpan/Test-Simple/lib/Test2/Event/Plan.pm
index b6b3ea9e5e..1986f595a7 100644
--- a/cpan/Test-Simple/lib/Test2/Event/Plan.pm
+++ b/cpan/Test-Simple/lib/Test2/Event/Plan.pm
@@ -2,7 +2,7 @@ package Test2::Event::Plan;
use strict;
use warnings;
-our $VERSION = '1.302056';
+our $VERSION = '1.302059';
BEGIN { require Test2::Event; our @ISA = qw(Test2::Event) }
diff --git a/cpan/Test-Simple/lib/Test2/Event/Skip.pm b/cpan/Test-Simple/lib/Test2/Event/Skip.pm
index a54ddf6cd0..dedb06d80f 100644
--- a/cpan/Test-Simple/lib/Test2/Event/Skip.pm
+++ b/cpan/Test-Simple/lib/Test2/Event/Skip.pm
@@ -2,7 +2,7 @@ package Test2::Event::Skip;
use strict;
use warnings;
-our $VERSION = '1.302056';
+our $VERSION = '1.302059';
BEGIN { require Test2::Event::Ok; our @ISA = qw(Test2::Event::Ok) }
diff --git a/cpan/Test-Simple/lib/Test2/Event/Subtest.pm b/cpan/Test-Simple/lib/Test2/Event/Subtest.pm
index 00a07c1337..f0b026e9e2 100644
--- a/cpan/Test-Simple/lib/Test2/Event/Subtest.pm
+++ b/cpan/Test-Simple/lib/Test2/Event/Subtest.pm
@@ -2,7 +2,7 @@ package Test2::Event::Subtest;
use strict;
use warnings;
-our $VERSION = '1.302056';
+our $VERSION = '1.302059';
BEGIN { require Test2::Event::Ok; our @ISA = qw(Test2::Event::Ok) }
diff --git a/cpan/Test-Simple/lib/Test2/Event/Waiting.pm b/cpan/Test-Simple/lib/Test2/Event/Waiting.pm
index 694e741ebe..2baa533bb5 100644
--- a/cpan/Test-Simple/lib/Test2/Event/Waiting.pm
+++ b/cpan/Test-Simple/lib/Test2/Event/Waiting.pm
@@ -2,7 +2,7 @@ package Test2::Event::Waiting;
use strict;
use warnings;
-our $VERSION = '1.302056';
+our $VERSION = '1.302059';
BEGIN { require Test2::Event; our @ISA = qw(Test2::Event) }
diff --git a/cpan/Test-Simple/lib/Test2/Formatter.pm b/cpan/Test-Simple/lib/Test2/Formatter.pm
index 9d0cc1a5ac..f3536c8661 100644
--- a/cpan/Test-Simple/lib/Test2/Formatter.pm
+++ b/cpan/Test-Simple/lib/Test2/Formatter.pm
@@ -2,7 +2,7 @@ package Test2::Formatter;
use strict;
use warnings;
-our $VERSION = '1.302056';
+our $VERSION = '1.302059';
my %ADDED;
diff --git a/cpan/Test-Simple/lib/Test2/Formatter/TAP.pm b/cpan/Test-Simple/lib/Test2/Formatter/TAP.pm
index d69f7676ba..93f53f0d62 100644
--- a/cpan/Test-Simple/lib/Test2/Formatter/TAP.pm
+++ b/cpan/Test-Simple/lib/Test2/Formatter/TAP.pm
@@ -3,7 +3,7 @@ use strict;
use warnings;
require PerlIO;
-our $VERSION = '1.302056';
+our $VERSION = '1.302059';
use Test2::Util::HashBase qw{
diff --git a/cpan/Test-Simple/lib/Test2/Hub.pm b/cpan/Test-Simple/lib/Test2/Hub.pm
index 1c6433336b..edc873bc1a 100644
--- a/cpan/Test-Simple/lib/Test2/Hub.pm
+++ b/cpan/Test-Simple/lib/Test2/Hub.pm
@@ -2,7 +2,7 @@ package Test2::Hub;
use strict;
use warnings;
-our $VERSION = '1.302056';
+our $VERSION = '1.302059';
use Carp qw/carp croak confess/;
diff --git a/cpan/Test-Simple/lib/Test2/Hub/Interceptor.pm b/cpan/Test-Simple/lib/Test2/Hub/Interceptor.pm
index 9ed129bab7..31bdd14d00 100644
--- a/cpan/Test-Simple/lib/Test2/Hub/Interceptor.pm
+++ b/cpan/Test-Simple/lib/Test2/Hub/Interceptor.pm
@@ -2,7 +2,7 @@ package Test2::Hub::Interceptor;
use strict;
use warnings;
-our $VERSION = '1.302056';
+our $VERSION = '1.302059';
use Test2::Hub::Interceptor::Terminator();
diff --git a/cpan/Test-Simple/lib/Test2/Hub/Interceptor/Terminator.pm b/cpan/Test-Simple/lib/Test2/Hub/Interceptor/Terminator.pm
index 83dd0a9df0..95fb1f12f6 100644
--- a/cpan/Test-Simple/lib/Test2/Hub/Interceptor/Terminator.pm
+++ b/cpan/Test-Simple/lib/Test2/Hub/Interceptor/Terminator.pm
@@ -2,7 +2,7 @@ package Test2::Hub::Interceptor::Terminator;
use strict;
use warnings;
-our $VERSION = '1.302056';
+our $VERSION = '1.302059';
1;
diff --git a/cpan/Test-Simple/lib/Test2/Hub/Subtest.pm b/cpan/Test-Simple/lib/Test2/Hub/Subtest.pm
index 5cbafb8366..88b079a500 100644
--- a/cpan/Test-Simple/lib/Test2/Hub/Subtest.pm
+++ b/cpan/Test-Simple/lib/Test2/Hub/Subtest.pm
@@ -2,7 +2,7 @@ package Test2::Hub::Subtest;
use strict;
use warnings;
-our $VERSION = '1.302056';
+our $VERSION = '1.302059';
BEGIN { require Test2::Hub; our @ISA = qw(Test2::Hub) }
diff --git a/cpan/Test-Simple/lib/Test2/IPC.pm b/cpan/Test-Simple/lib/Test2/IPC.pm
index d8d04f31c2..620f1f8314 100644
--- a/cpan/Test-Simple/lib/Test2/IPC.pm
+++ b/cpan/Test-Simple/lib/Test2/IPC.pm
@@ -2,7 +2,7 @@ package Test2::IPC;
use strict;
use warnings;
-our $VERSION = '1.302056';
+our $VERSION = '1.302059';
use Test2::API::Instance;
diff --git a/cpan/Test-Simple/lib/Test2/IPC/Driver.pm b/cpan/Test-Simple/lib/Test2/IPC/Driver.pm
index 68b65befcf..6e9d0c3fc3 100644
--- a/cpan/Test-Simple/lib/Test2/IPC/Driver.pm
+++ b/cpan/Test-Simple/lib/Test2/IPC/Driver.pm
@@ -2,7 +2,7 @@ package Test2::IPC::Driver;
use strict;
use warnings;
-our $VERSION = '1.302056';
+our $VERSION = '1.302059';
use Carp qw/confess longmess/;
diff --git a/cpan/Test-Simple/lib/Test2/IPC/Driver/Files.pm b/cpan/Test-Simple/lib/Test2/IPC/Driver/Files.pm
index ad6a0c2565..5fddaca3fb 100644
--- a/cpan/Test-Simple/lib/Test2/IPC/Driver/Files.pm
+++ b/cpan/Test-Simple/lib/Test2/IPC/Driver/Files.pm
@@ -2,7 +2,7 @@ package Test2::IPC::Driver::Files;
use strict;
use warnings;
-our $VERSION = '1.302056';
+our $VERSION = '1.302059';
BEGIN { require Test2::IPC::Driver; our @ISA = qw(Test2::IPC::Driver) }
diff --git a/cpan/Test-Simple/lib/Test2/Util.pm b/cpan/Test-Simple/lib/Test2/Util.pm
index 436d8b844b..9b810c6af1 100644
--- a/cpan/Test-Simple/lib/Test2/Util.pm
+++ b/cpan/Test-Simple/lib/Test2/Util.pm
@@ -2,7 +2,7 @@ package Test2::Util;
use strict;
use warnings;
-our $VERSION = '1.302056';
+our $VERSION = '1.302059';
use Config qw/%Config/;
diff --git a/cpan/Test-Simple/lib/Test2/Util/ExternalMeta.pm b/cpan/Test-Simple/lib/Test2/Util/ExternalMeta.pm
index d4bbf20b82..e99b360dac 100644
--- a/cpan/Test-Simple/lib/Test2/Util/ExternalMeta.pm
+++ b/cpan/Test-Simple/lib/Test2/Util/ExternalMeta.pm
@@ -2,7 +2,7 @@ package Test2::Util::ExternalMeta;
use strict;
use warnings;
-our $VERSION = '1.302056';
+our $VERSION = '1.302059';
use Carp qw/croak/;
diff --git a/cpan/Test-Simple/lib/Test2/Util/HashBase.pm b/cpan/Test-Simple/lib/Test2/Util/HashBase.pm
index 19cb225373..6594c52e71 100644
--- a/cpan/Test-Simple/lib/Test2/Util/HashBase.pm
+++ b/cpan/Test-Simple/lib/Test2/Util/HashBase.pm
@@ -2,7 +2,7 @@ package Test2::Util::HashBase;
use strict;
use warnings;
-our $VERSION = '1.302056';
+our $VERSION = '1.302059';
require Carp;
diff --git a/cpan/Test-Simple/lib/Test2/Util/Trace.pm b/cpan/Test-Simple/lib/Test2/Util/Trace.pm
index 3ad6578630..189fe5f8b6 100644
--- a/cpan/Test-Simple/lib/Test2/Util/Trace.pm
+++ b/cpan/Test-Simple/lib/Test2/Util/Trace.pm
@@ -2,7 +2,7 @@ package Test2::Util::Trace;
use strict;
use warnings;
-our $VERSION = '1.302056';
+our $VERSION = '1.302059';
use Test2::Util qw/get_tid/;
diff --git a/cpan/Test-Simple/lib/ok.pm b/cpan/Test-Simple/lib/ok.pm
index e1552c29ff..4a42d7570f 100644
--- a/cpan/Test-Simple/lib/ok.pm
+++ b/cpan/Test-Simple/lib/ok.pm
@@ -1,5 +1,5 @@
package ok;
-$ok::VERSION = '1.302056';
+$ok::VERSION = '1.302059';
use strict;
use Test::More ();
diff --git a/cpan/Test-Simple/t/Legacy/is_deeply_fail.t b/cpan/Test-Simple/t/Legacy/is_deeply_fail.t
index 26036fb960..21efe87a25 100644
--- a/cpan/Test-Simple/t/Legacy/is_deeply_fail.t
+++ b/cpan/Test-Simple/t/Legacy/is_deeply_fail.t
@@ -25,7 +25,7 @@ package main;
my $TB = Test::Builder->create;
-$TB->plan(tests => 100);
+$TB->plan(tests => 102);
# Utility testing functions.
sub ok ($;$) {
@@ -419,3 +419,11 @@ ERR
ok !is_deeply( {x => ''}, {x => undef}, "{x => ''} != {x => undef}" );
is( $out, "not ok 41 - {x => ''} != {x => undef}\n" );
}
+
+# this will also happily fail before 5.10, even though there's no VSTRING ref type
+{
+ my $version1 = v1.2.3;
+ my $version2 = v1.2.4;
+ ok !is_deeply( [\\$version1], [\\$version2], "version objects");
+ is( $out, "not ok 42 - version objects\n" );
+}
diff --git a/cpan/Test-Simple/t/Test2/behavior/special_names.t b/cpan/Test-Simple/t/Test2/behavior/special_names.t
index 90882f5b72..b748cfac27 100644
--- a/cpan/Test-Simple/t/Test2/behavior/special_names.t
+++ b/cpan/Test-Simple/t/Test2/behavior/special_names.t
@@ -12,38 +12,6 @@ BEGIN { require "t/tools.pl" };
use Test2::API qw/test2_stack/;
-sub capture(&) {
- my $code = shift;
-
- my ($err, $out) = ("", "");
-
- my $handles = test2_stack->top->format->handles;
- my ($ok, $e);
- {
- my ($out_fh, $err_fh);
-
- ($ok, $e) = try {
- open($out_fh, '>', \$out) or die "Failed to open a temporary STDOUT: $!";
- open($err_fh, '>', \$err) or die "Failed to open a temporary STDERR: $!";
-
- test2_stack->top->format->set_handles([$out_fh, $err_fh, $out_fh]);
-
- $code->();
- };
- }
- test2_stack->top->format->set_handles($handles);
-
- die $e unless $ok;
-
- $err =~ s/ $/_/mg;
- $out =~ s/ $/_/mg;
-
- return {
- STDOUT => $out,
- STDERR => $err,
- };
-}
-
# Ensure the top hub is generated
test2_stack->top;
diff --git a/cpan/Test-Simple/t/Test2/legacy/TAP.t b/cpan/Test-Simple/t/Test2/legacy/TAP.t
index 971849f560..84bb18a170 100644
--- a/cpan/Test-Simple/t/Test2/legacy/TAP.t
+++ b/cpan/Test-Simple/t/Test2/legacy/TAP.t
@@ -14,38 +14,6 @@ BEGIN { require "t/tools.pl" };
use Test2::API qw/test2_stack/;
use Test::Builder::Formatter;
-sub capture(&) {
- my $code = shift;
-
- my ($err, $out) = ("", "");
-
- my $handles = test2_stack->top->format->handles;
- my ($ok, $e);
- {
- my ($out_fh, $err_fh);
-
- ($ok, $e) = try {
- open($out_fh, '>', \$out) or die "Failed to open a temporary STDOUT: $!";
- open($err_fh, '>', \$err) or die "Failed to open a temporary STDERR: $!";
-
- test2_stack->top->format->set_handles([$out_fh, $err_fh, $out_fh]);
-
- $code->();
- };
- }
- test2_stack->top->format->set_handles($handles);
-
- die $e unless $ok;
-
- $err =~ s/ $/_/mg;
- $out =~ s/ $/_/mg;
-
- return {
- STDOUT => $out,
- STDERR => $err,
- };
-}
-
# The tools in tools.pl have some intentional differences from the Test::More
# versions, these behave more like Test::More which is important for
# back-compat.
diff --git a/cpan/Test-Simple/t/Test2/modules/IPC/Driver/Files.t b/cpan/Test-Simple/t/Test2/modules/IPC/Driver/Files.t
index 1691751f1c..6ede9df45a 100644
--- a/cpan/Test-Simple/t/Test2/modules/IPC/Driver/Files.t
+++ b/cpan/Test-Simple/t/Test2/modules/IPC/Driver/Files.t
@@ -6,7 +6,7 @@ use List::Util qw/shuffle/;
use strict;
use warnings;
-sub capture(&) {
+sub simple_capture(&) {
my $code = shift;
my ($err, $out) = ("", "");
@@ -136,7 +136,7 @@ ok(!-d $tmpdir, "cleaned up temp dir");
my @lines;
my $file = __FILE__;
- my $out = capture {
+ my $out = simple_capture {
local $ENV{T2_KEEP_TEMPDIR} = 1;
my $ipc = Test2::IPC::Driver::Files->new();
@@ -175,7 +175,7 @@ ok(!-d $tmpdir, "cleaned up temp dir");
like($out->{STDERR}, qr/^IPC Fatal Error: File for hub '12345-1-1' already exists/m, "Got message for duplicate hub");
like($out->{STDERR}, qr/^IPC Fatal Error: File for hub '12345-1-1' does not exist/m, "Cannot remove hub twice");
- $out = capture {
+ $out = simple_capture {
my $ipc = Test2::IPC::Driver::Files->new();
$ipc->add_hub($hid);
my $trace = Test2::Util::Trace->new(frame => [__PACKAGE__, __FILE__, __LINE__, 'foo']);
@@ -190,7 +190,7 @@ ok(!-d $tmpdir, "cleaned up temp dir");
like($out->{STDERR}, qr/Origin PID:\s+$$/, "Got pid");
like($out->{STDERR}, qr/Error: Can't store GLOB items/, "Got cause");
- $out = capture {
+ $out = simple_capture {
my $ipc = Test2::IPC::Driver::Files->new();
local $@;
eval { $ipc->send($hid, bless({ foo => 1 }, 'Foo')) };
@@ -199,7 +199,7 @@ ok(!-d $tmpdir, "cleaned up temp dir");
};
like($out->{STDERR}, qr/IPC Fatal Error: hub '12345-1-1' is not available, failed to send event!/, "Cannot send to missing hub");
- $out = capture {
+ $out = simple_capture {
my $ipc = Test2::IPC::Driver::Files->new();
$tmpdir = $ipc->tempdir;
$ipc->add_hub($hid);
@@ -212,7 +212,7 @@ ok(!-d $tmpdir, "cleaned up temp dir");
like($out->{STDERR}, qr/IPC Fatal Error: Not all files from hub '12345-1-1' have been collected/, "Leftover files");
like($out->{STDERR}, qr/IPC Fatal Error: Leftover files in the directory \(.*\.ready\)/, "What file");
- $out = capture {
+ $out = simple_capture {
my $ipc = Test2::IPC::Driver::Files->new();
$ipc->add_hub($hid);
@@ -233,7 +233,7 @@ ok(!-d $tmpdir, "cleaned up temp dir");
close($fh);
Storable::store({}, $fn);
- $out = capture { eval { $ipc->read_event_file($fn) } };
+ $out = simple_capture { eval { $ipc->read_event_file($fn) } };
like(
$out->{STDERR},
qr/IPC Fatal Error: Got an unblessed object: 'HASH\(.*\)'/,
@@ -241,7 +241,7 @@ ok(!-d $tmpdir, "cleaned up temp dir");
);
Storable::store(bless({}, 'Test2::Event::FakeEvent'), $fn);
- $out = capture { eval { $ipc->read_event_file($fn) } };
+ $out = simple_capture { eval { $ipc->read_event_file($fn) } };
like(
$out->{STDERR},
qr{IPC Fatal Error: Event has unknown type \(Test2::Event::FakeEvent\), tried to load 'Test2/Event/FakeEvent\.pm' but failed: Can't locate Test2/Event/FakeEvent\.pm},
@@ -249,7 +249,7 @@ ok(!-d $tmpdir, "cleaned up temp dir");
);
Storable::store(bless({}, 'Test2::API'), $fn);
- $out = capture { eval { $ipc->read_event_file($fn) } };
+ $out = simple_capture { eval { $ipc->read_event_file($fn) } };
like(
$out->{STDERR},
qr{'Test2::API=HASH\(.*\)' is not a 'Test2::Event' object},
@@ -257,7 +257,7 @@ ok(!-d $tmpdir, "cleaned up temp dir");
);
Storable::store(bless({}, 'Foo'), $fn);
- $out = capture {
+ $out = simple_capture {
local @INC;
push @INC => ('t/lib', 'lib');
eval { $ipc->read_event_file($fn) };
diff --git a/cpan/Test-Simple/t/regression/721-nested-streamed-subtest.t b/cpan/Test-Simple/t/regression/721-nested-streamed-subtest.t
new file mode 100644
index 0000000000..d83ed18186
--- /dev/null
+++ b/cpan/Test-Simple/t/regression/721-nested-streamed-subtest.t
@@ -0,0 +1,96 @@
+use strict;
+use warnings;
+
+BEGIN { require "t/tools.pl" }
+
+# This module's exports interfere with the ones in t/tools.pl
+use Test::More ();
+use Test2::API qw/run_subtest test2_stack/;
+
+{
+ test2_stack->top;
+ my $temp_hub = test2_stack->new_hub();
+
+ my $output = capture {
+ run_subtest(
+ 'parent',
+ sub {
+ run_subtest(
+ 'buffered',
+ sub {
+ ok(1, 'b1');
+ ok(1, 'b2');
+ },
+ {buffered => 1},
+ );
+ run_subtest(
+ 'streamed',
+ sub {
+ ok(1, 's1');
+ ok(1, 's2');
+ },
+ {buffered => 0},
+ );
+ },
+ {buffered => 1},
+ );
+ };
+
+ test2_stack->pop($temp_hub);
+
+ Test::More::subtest(
+ 'Test2::API::run_subtest',
+ sub {
+ is($output->{STDERR}, q{}, 'no output on stderr');
+ like($output->{STDOUT}, qr/ +ok 1 - b1/, 'got ok output for tests in buffered subtest');
+ like($output->{STDOUT}, qr/ +ok 2 - b2/, 'got ok output for tests in buffered subtest');
+ like($output->{STDOUT}, qr/ +ok 1 - s1/, 'got ok output for tests in streamed subtest');
+ like($output->{STDOUT}, qr/ +ok 2 - s2/, 'got ok output for tests in streamed subtest');
+ }
+ );
+}
+
+{
+ test2_stack->top;
+ my $temp_hub = test2_stack->new_hub();
+
+ my $output = capture {
+ run_subtest(
+ 'parent',
+ sub {
+ run_subtest(
+ 'buffered',
+ sub {
+ ok(1, 'b1');
+ ok(1, 'b2');
+ },
+ {buffered => 1},
+ );
+ Test::More::subtest(
+ 'streamed',
+ sub {
+ ok(1, 's1');
+ ok(1, 's2');
+ },
+ {buffered => 0},
+ );
+ },
+ {buffered => 1},
+ );
+ };
+
+ test2_stack->pop($temp_hub);
+
+ Test::More::subtest(
+ 'Test::More::subtest and Test2::API::run_subtest',
+ sub {
+ is($output->{STDERR}, q{}, 'no output on stderr');
+ like($output->{STDOUT}, qr/ +ok 1 - b1/, 'got ok output for tests in buffered subtest');
+ like($output->{STDOUT}, qr/ +ok 2 - b2/, 'got ok output for tests in buffered subtest');
+ like($output->{STDOUT}, qr/ +ok 1 - s1/, 'got ok output for tests in streamed subtest');
+ like($output->{STDOUT}, qr/ +ok 2 - s2/, 'got ok output for tests in streamed subtest');
+ }
+ );
+}
+
+done_testing;
diff --git a/cpan/Test-Simple/t/tools.pl b/cpan/Test-Simple/t/tools.pl
index e683121413..e97bc78707 100644
--- a/cpan/Test-Simple/t/tools.pl
+++ b/cpan/Test-Simple/t/tools.pl
@@ -1,7 +1,7 @@
use Scalar::Util qw/blessed/;
use Test2::Util qw/try/;
-use Test2::API qw/context run_subtest/;
+use Test2::API qw/context run_subtest test2_stack/;
use Test2::Hub::Interceptor();
use Test2::Hub::Interceptor::Terminator();
@@ -214,4 +214,36 @@ sub tests {
return $bool;
}
+sub capture(&) {
+ my $code = shift;
+
+ my ($err, $out) = ("", "");
+
+ my $handles = test2_stack->top->format->handles;
+ my ($ok, $e);
+ {
+ my ($out_fh, $err_fh);
+
+ ($ok, $e) = try {
+ open($out_fh, '>', \$out) or die "Failed to open a temporary STDOUT: $!";
+ open($err_fh, '>', \$err) or die "Failed to open a temporary STDERR: $!";
+
+ test2_stack->top->format->set_handles([$out_fh, $err_fh, $out_fh]);
+
+ $code->();
+ };
+ }
+ test2_stack->top->format->set_handles($handles);
+
+ die $e unless $ok;
+
+ $err =~ s/ $/_/mg;
+ $out =~ s/ $/_/mg;
+
+ return {
+ STDOUT => $out,
+ STDERR => $err,
+ };
+}
+
1;