In perl.git, the branch blead has been updated <http://perl5.git.perl.org/perl.git/commitdiff/18864292b4751beee108b3b4983f9ddf2228f8ef?hp=c2062197fdd9d9368439fc4f47b6043c665f6e1e>
- Log ----------------------------------------------------------------- commit 18864292b4751beee108b3b4983f9ddf2228f8ef Author: Chad Granum <[email protected]> Date: Sat Jan 31 12:19:22 2015 -0800 Test-Simple Version Bump, 1.301001_098 (RC18) M MANIFEST M Porting/Maintainers.pl M cpan/Test-Simple/lib/Test/Builder.pm M cpan/Test-Simple/lib/Test/Builder/Module.pm M cpan/Test-Simple/lib/Test/Builder/Tester.pm M cpan/Test-Simple/lib/Test/Builder/Tester/Color.pm M cpan/Test-Simple/lib/Test/FAQ.pod M cpan/Test-Simple/lib/Test/More.pm M cpan/Test-Simple/lib/Test/More/DeepCheck.pm M cpan/Test-Simple/lib/Test/More/DeepCheck/Strict.pm M cpan/Test-Simple/lib/Test/More/DeepCheck/Tolerant.pm M cpan/Test-Simple/lib/Test/More/Tools.pm M cpan/Test-Simple/lib/Test/MostlyLike.pm M cpan/Test-Simple/lib/Test/Simple.pm M cpan/Test-Simple/lib/Test/Stream.pm M cpan/Test-Simple/lib/Test/Stream/API.pm M cpan/Test-Simple/lib/Test/Stream/Architecture.pod M cpan/Test-Simple/lib/Test/Stream/ArrayBase.pm M cpan/Test-Simple/lib/Test/Stream/ArrayBase/Meta.pm M cpan/Test-Simple/lib/Test/Stream/Carp.pm M cpan/Test-Simple/lib/Test/Stream/Context.pm M cpan/Test-Simple/lib/Test/Stream/Event.pm M cpan/Test-Simple/lib/Test/Stream/Event/Bail.pm M cpan/Test-Simple/lib/Test/Stream/Event/Diag.pm M cpan/Test-Simple/lib/Test/Stream/Event/Finish.pm M cpan/Test-Simple/lib/Test/Stream/Event/Note.pm M cpan/Test-Simple/lib/Test/Stream/Event/Ok.pm M cpan/Test-Simple/lib/Test/Stream/Event/Plan.pm M cpan/Test-Simple/lib/Test/Stream/Event/Subtest.pm M cpan/Test-Simple/lib/Test/Stream/ExitMagic.pm M cpan/Test-Simple/lib/Test/Stream/ExitMagic/Context.pm A cpan/Test-Simple/lib/Test/Stream/Explanation.pod M cpan/Test-Simple/lib/Test/Stream/Exporter.pm M cpan/Test-Simple/lib/Test/Stream/Exporter/Meta.pm M cpan/Test-Simple/lib/Test/Stream/ForceExit.pm M cpan/Test-Simple/lib/Test/Stream/IOSets.pm M cpan/Test-Simple/lib/Test/Stream/Meta.pm M cpan/Test-Simple/lib/Test/Stream/PackageUtil.pm M cpan/Test-Simple/lib/Test/Stream/Subtest.pm M cpan/Test-Simple/lib/Test/Stream/Tester.pm M cpan/Test-Simple/lib/Test/Stream/Tester/Checks.pm M cpan/Test-Simple/lib/Test/Stream/Tester/Checks/Event.pm M cpan/Test-Simple/lib/Test/Stream/Tester/Events.pm M cpan/Test-Simple/lib/Test/Stream/Tester/Events/Event.pm M cpan/Test-Simple/lib/Test/Stream/Tester/Grab.pm M cpan/Test-Simple/lib/Test/Stream/Threads.pm M cpan/Test-Simple/lib/Test/Stream/Toolset.pm M cpan/Test-Simple/lib/Test/Stream/Util.pm M cpan/Test-Simple/lib/Test/Tester.pm M cpan/Test-Simple/lib/Test/Tester/Capture.pm M cpan/Test-Simple/lib/Test/Tutorial/WritingTests.pod M cpan/Test-Simple/lib/Test/Tutorial/WritingTools.pod M cpan/Test-Simple/lib/Test/use/ok.pm M cpan/Test-Simple/lib/ok.pm M cpan/Test-Simple/t/Behavior/MonkeyPatching_diag.t M cpan/Test-Simple/t/Behavior/MonkeyPatching_plan.t A cpan/Test-Simple/t/Behavior/cmp_ok_undef.t A cpan/Test-Simple/t/Behavior/event_clone_args.t M cpan/Test-Simple/t/Behavior/skip_all_in_subtest.t D cpan/Test-Simple/t/Legacy/ribasushi_diag.t M cpan/Test-Simple/t/Legacy/subtest/basic.t M cpan/Test-Simple/t/Test-Stream-Event-Diag.t M cpan/Test-Simple/t/Test-Stream-ForceExit.t commit ad51375676d14fd63b202ee0090e1351632109ff Author: Father Chrysostomos <[email protected]> Date: Sat Jan 31 09:34:34 2015 -0800 Sort perldiag M pod/perldiag.pod ----------------------------------------------------------------------- Summary of changes: MANIFEST | 4 +- Porting/Maintainers.pl | 5 +- cpan/Test-Simple/lib/Test/Builder.pm | 6 +- cpan/Test-Simple/lib/Test/Builder/Module.pm | 7 +- cpan/Test-Simple/lib/Test/Builder/Tester.pm | 8 +- cpan/Test-Simple/lib/Test/Builder/Tester/Color.pm | 7 +- cpan/Test-Simple/lib/Test/FAQ.pod | 6 +- cpan/Test-Simple/lib/Test/More.pm | 8 +- cpan/Test-Simple/lib/Test/More/DeepCheck.pm | 6 +- cpan/Test-Simple/lib/Test/More/DeepCheck/Strict.pm | 6 +- .../lib/Test/More/DeepCheck/Tolerant.pm | 6 +- cpan/Test-Simple/lib/Test/More/Tools.pm | 27 +- cpan/Test-Simple/lib/Test/MostlyLike.pm | 5 +- cpan/Test-Simple/lib/Test/Simple.pm | 11 +- cpan/Test-Simple/lib/Test/Stream.pm | 11 +- cpan/Test-Simple/lib/Test/Stream/API.pm | 13 +- cpan/Test-Simple/lib/Test/Stream/Architecture.pod | 6 +- cpan/Test-Simple/lib/Test/Stream/ArrayBase.pm | 6 +- cpan/Test-Simple/lib/Test/Stream/ArrayBase/Meta.pm | 6 +- cpan/Test-Simple/lib/Test/Stream/Carp.pm | 6 +- cpan/Test-Simple/lib/Test/Stream/Context.pm | 11 +- cpan/Test-Simple/lib/Test/Stream/Event.pm | 6 +- cpan/Test-Simple/lib/Test/Stream/Event/Bail.pm | 6 +- cpan/Test-Simple/lib/Test/Stream/Event/Diag.pm | 13 +- cpan/Test-Simple/lib/Test/Stream/Event/Finish.pm | 6 +- cpan/Test-Simple/lib/Test/Stream/Event/Note.pm | 13 +- cpan/Test-Simple/lib/Test/Stream/Event/Ok.pm | 6 +- cpan/Test-Simple/lib/Test/Stream/Event/Plan.pm | 6 +- cpan/Test-Simple/lib/Test/Stream/Event/Subtest.pm | 6 +- cpan/Test-Simple/lib/Test/Stream/ExitMagic.pm | 6 +- .../lib/Test/Stream/ExitMagic/Context.pm | 6 +- cpan/Test-Simple/lib/Test/Stream/Explanation.pod | 943 +++++++++++++++++++++ cpan/Test-Simple/lib/Test/Stream/Exporter.pm | 6 +- cpan/Test-Simple/lib/Test/Stream/Exporter/Meta.pm | 6 +- cpan/Test-Simple/lib/Test/Stream/ForceExit.pm | 2 +- cpan/Test-Simple/lib/Test/Stream/IOSets.pm | 6 +- cpan/Test-Simple/lib/Test/Stream/Meta.pm | 6 +- cpan/Test-Simple/lib/Test/Stream/PackageUtil.pm | 6 +- cpan/Test-Simple/lib/Test/Stream/Subtest.pm | 6 +- cpan/Test-Simple/lib/Test/Stream/Tester.pm | 6 +- cpan/Test-Simple/lib/Test/Stream/Tester/Checks.pm | 6 +- .../lib/Test/Stream/Tester/Checks/Event.pm | 7 +- cpan/Test-Simple/lib/Test/Stream/Tester/Events.pm | 7 +- .../lib/Test/Stream/Tester/Events/Event.pm | 7 +- cpan/Test-Simple/lib/Test/Stream/Tester/Grab.pm | 4 +- cpan/Test-Simple/lib/Test/Stream/Threads.pm | 6 +- cpan/Test-Simple/lib/Test/Stream/Toolset.pm | 7 +- cpan/Test-Simple/lib/Test/Stream/Util.pm | 7 +- cpan/Test-Simple/lib/Test/Tester.pm | 8 +- cpan/Test-Simple/lib/Test/Tester/Capture.pm | 6 +- .../Test-Simple/lib/Test/Tutorial/WritingTests.pod | 4 +- .../Test-Simple/lib/Test/Tutorial/WritingTools.pod | 9 +- cpan/Test-Simple/lib/Test/use/ok.pm | 8 +- cpan/Test-Simple/lib/ok.pm | 8 +- cpan/Test-Simple/t/Behavior/MonkeyPatching_diag.t | 21 +- cpan/Test-Simple/t/Behavior/MonkeyPatching_plan.t | 31 +- cpan/Test-Simple/t/Behavior/cmp_ok_undef.t | 19 + cpan/Test-Simple/t/Behavior/event_clone_args.t | 22 + cpan/Test-Simple/t/Behavior/skip_all_in_subtest.t | 11 + cpan/Test-Simple/t/Legacy/ribasushi_diag.t | 59 -- cpan/Test-Simple/t/Legacy/subtest/basic.t | 14 +- cpan/Test-Simple/t/Test-Stream-Event-Diag.t | 4 +- cpan/Test-Simple/t/Test-Stream-ForceExit.t | 4 +- pod/perldiag.pod | 78 +- 64 files changed, 1352 insertions(+), 237 deletions(-) create mode 100644 cpan/Test-Simple/lib/Test/Stream/Explanation.pod create mode 100644 cpan/Test-Simple/t/Behavior/cmp_ok_undef.t create mode 100644 cpan/Test-Simple/t/Behavior/event_clone_args.t delete mode 100644 cpan/Test-Simple/t/Legacy/ribasushi_diag.t diff --git a/MANIFEST b/MANIFEST index ad879e2..cc62528 100644 --- a/MANIFEST +++ b/MANIFEST @@ -2343,6 +2343,7 @@ cpan/Test-Simple/lib/Test/Stream/Event.pm Test::Simple module cpan/Test-Simple/lib/Test/Stream/Event/Subtest.pm Test::Simple module cpan/Test-Simple/lib/Test/Stream/ExitMagic/Context.pm Test::Simple module cpan/Test-Simple/lib/Test/Stream/ExitMagic.pm Test::Simple module +cpan/Test-Simple/lib/Test/Stream/Explanation.pod Test::Simple POD cpan/Test-Simple/lib/Test/Stream/Exporter/Meta.pm Test::Simple module cpan/Test-Simple/lib/Test/Stream/Exporter.pm Test::Simple module cpan/Test-Simple/lib/Test/Stream/ForceExit.pm Test-Simple module @@ -2372,9 +2373,11 @@ cpan/Test-Simple/t/Behavior/388-threadedsubtest.load Test::Simple Test cpan/Test-Simple/t/Behavior/388-threadedsubtest.t Test::Simple test cpan/Test-Simple/t/Behavior/478-cmp_ok_hash.t Test::Simple test cpan/Test-Simple/t/Behavior/490-inherit_exporter.t Test::Simple test +cpan/Test-Simple/t/Behavior/cmp_ok_undef.t Test::Simple Test cpan/Test-Simple/t/Behavior/cmp_ok_xor.t Test::Simple Test cpan/Test-Simple/t/Behavior/CustomOutput.t Test::Simple Test cpan/Test-Simple/t/Behavior/encoding_test.t Test::Simple Test +cpan/Test-Simple/t/Behavior/event_clone_args.t Test::Simple Test cpan/Test-Simple/t/Behavior/fork_new_end.t Test::Simple Test cpan/Test-Simple/t/Behavior/MonkeyPatching_diag.t Test::Simple Test cpan/Test-Simple/t/Behavior/MonkeyPatching_done_testing.t Test::Simple Test @@ -2463,7 +2466,6 @@ cpan/Test-Simple/t/Legacy/plan_skip_all.t Test::Simple Test cpan/Test-Simple/t/Legacy/plan.t Test::Simple Test cpan/Test-Simple/t/Legacy/pod.t Test::Simple Test cpan/Test-Simple/t/Legacy/require_ok.t Test::Simple Test -cpan/Test-Simple/t/Legacy/ribasushi_diag.t Test::Simple Test cpan/Test-Simple/t/Legacy/ribasushi_threads2.t Test::Simple Test cpan/Test-Simple/t/Legacy/ribasushi_threads.t Test::Simple Test cpan/Test-Simple/t/Legacy/Simple/load.t Test::Simple Test diff --git a/Porting/Maintainers.pl b/Porting/Maintainers.pl index 9ad392a..5c38b84 100755 --- a/Porting/Maintainers.pl +++ b/Porting/Maintainers.pl @@ -1071,7 +1071,7 @@ use File::Glob qw(:case); }, 'Test::Simple' => { - 'DISTRIBUTION' => 'EXODIST/Test-Simple-1.301001_073.tar.gz', + 'DISTRIBUTION' => 'EXODIST/Test-Simple-1.301001_098.tar.gz', 'FILES' => q[cpan/Test-Simple], 'EXCLUDED' => [ qr{^t/xt}, @@ -1083,6 +1083,9 @@ use File::Glob qw(:case); examples/subtest.t t/Legacy/00compile.t t/Legacy/pod.t + t/xxx-changes_updated.t + t/zzz-check-breaks.t + t/Legacy/ribasushi_diag.t ), ], 'CUSTOMIZED' => [ diff --git a/cpan/Test-Simple/lib/Test/Builder.pm b/cpan/Test-Simple/lib/Test/Builder.pm index c690851..11dadc7 100644 --- a/cpan/Test-Simple/lib/Test/Builder.pm +++ b/cpan/Test-Simple/lib/Test/Builder.pm @@ -4,7 +4,7 @@ use 5.008001; use strict; use warnings; -our $VERSION = '1.301001_097'; +our $VERSION = '1.301001_098'; $VERSION = eval $VERSION; ## no critic (BuiltinFunctions::ProhibitStringyEval) @@ -955,6 +955,8 @@ __END__ =pod +=encoding UTF-8 + =head1 NAME Test::Builder - *DEPRECATED* Module for building testing libraries. @@ -1217,8 +1219,6 @@ work, however in the distant future it will be removed. L<Test::Stream> upon which Test::Builder is now built, provides hooks and API's for doing everything that previously required monkeypatching. -=encoding utf8 - =head1 TUTORIALS =over 4 diff --git a/cpan/Test-Simple/lib/Test/Builder/Module.pm b/cpan/Test-Simple/lib/Test/Builder/Module.pm index ff109f8..a5d8eba 100644 --- a/cpan/Test-Simple/lib/Test/Builder/Module.pm +++ b/cpan/Test-Simple/lib/Test/Builder/Module.pm @@ -8,9 +8,12 @@ use Test::Builder 0.99; require Exporter; our @ISA = qw(Exporter); -our $VERSION = '1.301001_097'; +our $VERSION = '1.301001_098'; $VERSION = eval $VERSION; ## no critic (BuiltinFunctions::ProhibitStringyEval) +=pod + +=encoding UTF-8 =head1 NAME @@ -185,8 +188,6 @@ sub builder { __END__ -=encoding utf8 - =head1 SOURCE The source code repository for Test::More can be found at diff --git a/cpan/Test-Simple/lib/Test/Builder/Tester.pm b/cpan/Test-Simple/lib/Test/Builder/Tester.pm index 324f91e..8762147 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.301001_097'; +our $VERSION = '1.301001_098'; $VERSION = eval $VERSION; ## no critic (BuiltinFunctions::ProhibitStringyEval) use Test::Stream 1.301001 '-internal'; @@ -9,6 +9,10 @@ use Test::Builder 1.301001; use Symbol; use Test::Stream::Carp qw/croak/; +=pod + +=encoding UTF-8 + =head1 NAME Test::Builder::Tester - *DEPRECATED* test testsuites that have been built with @@ -465,8 +469,6 @@ me use his testing system to try this module out on. L<Test::Builder>, L<Test::Builder::Tester::Color>, L<Test::More>. -=encoding utf8 - =head1 SOURCE The source code repository for Test::More can be found at diff --git a/cpan/Test-Simple/lib/Test/Builder/Tester/Color.pm b/cpan/Test-Simple/lib/Test/Builder/Tester/Color.pm index 4a1accf..675a86a 100644 --- a/cpan/Test-Simple/lib/Test/Builder/Tester/Color.pm +++ b/cpan/Test-Simple/lib/Test/Builder/Tester/Color.pm @@ -1,12 +1,15 @@ package Test::Builder::Tester::Color; use strict; -our $VERSION = '1.301001_097'; +our $VERSION = '1.301001_098'; $VERSION = eval $VERSION; ## no critic (BuiltinFunctions::ProhibitStringyEval) use Test::Stream 1.301001 '-internal'; require Test::Builder::Tester; +=pod + +=encoding UTF-8 =head1 NAME @@ -54,8 +57,6 @@ L<Test::Builder::Tester>, L<Term::ANSIColor> __END__ -=encoding utf8 - =head1 SOURCE The source code repository for Test::More can be found at diff --git a/cpan/Test-Simple/lib/Test/FAQ.pod b/cpan/Test-Simple/lib/Test/FAQ.pod index 232ec99..770984a 100644 --- a/cpan/Test-Simple/lib/Test/FAQ.pod +++ b/cpan/Test-Simple/lib/Test/FAQ.pod @@ -1,3 +1,7 @@ +=pod + +=encoding UTF-8 + =head1 NAME Test::FAQ - Frequently Asked Questions about testing with Perl @@ -376,8 +380,6 @@ not do any testing. It simply returns true or false. Use the following code... # Now you can use the testing function. print is_deeply( "foo", "bar" ) ? "Yes" : "No"; -=encoding utf8 - =head1 SOURCE The source code repository for Test::More can be found at diff --git a/cpan/Test-Simple/lib/Test/More.pm b/cpan/Test-Simple/lib/Test/More.pm index df11bc5..8b812ac 100644 --- a/cpan/Test-Simple/lib/Test/More.pm +++ b/cpan/Test-Simple/lib/Test/More.pm @@ -4,7 +4,7 @@ use 5.008001; use strict; use warnings; -our $VERSION = '1.301001_097'; +our $VERSION = '1.301001_098'; $VERSION = eval $VERSION; ## no critic (BuiltinFunctions::ProhibitStringyEval) use Test::Stream 1.301001 '-internal'; @@ -393,6 +393,10 @@ sub use_ok($;@) { __END__ +=pod + +=encoding UTF-8 + =head1 NAME Test::More - The defacto standard in unit testing tools. @@ -1742,8 +1746,6 @@ L<Bundle::Test> installs a whole bunch of useful test modules. L<Test::Most> Most commonly needed test functions and features. -=encoding utf8 - =head1 SOURCE The source code repository for Test::More can be found at diff --git a/cpan/Test-Simple/lib/Test/More/DeepCheck.pm b/cpan/Test-Simple/lib/Test/More/DeepCheck.pm index 4ec03fa..0f9ae9a 100644 --- a/cpan/Test-Simple/lib/Test/More/DeepCheck.pm +++ b/cpan/Test-Simple/lib/Test/More/DeepCheck.pm @@ -108,6 +108,10 @@ sub format_stack { __END__ +=pod + +=encoding UTF-8 + =head1 NAME Test::More::DeepCheck - Base class or is_deeply() and mostly_like() @@ -122,8 +126,6 @@ code shared betweent he 2 tools. Most of this was refactored from the original C<is_deeply()> implementation. If you find any bugs or incompatabilities please report them. -=encoding utf8 - =head1 SOURCE The source code repository for Test::More can be found at diff --git a/cpan/Test-Simple/lib/Test/More/DeepCheck/Strict.pm b/cpan/Test-Simple/lib/Test/More/DeepCheck/Strict.pm index d50e980..5ac69e8 100644 --- a/cpan/Test-Simple/lib/Test/More/DeepCheck/Strict.pm +++ b/cpan/Test-Simple/lib/Test/More/DeepCheck/Strict.pm @@ -217,6 +217,10 @@ sub _check_hash { __END__ +=pod + +=encoding UTF-8 + =head1 NAME Test::More::DeepCheck::Strict - Where is_deeply() is implemented. @@ -227,8 +231,6 @@ This is the package where the code for C<is_deeply()> from L<Test::More> lives. This code was refactored into this form, but should remain 100% compatible with the old implementation. If you find an incompatability please report it. -=encoding utf8 - =head1 SOURCE The source code repository for Test::More can be found at diff --git a/cpan/Test-Simple/lib/Test/More/DeepCheck/Tolerant.pm b/cpan/Test-Simple/lib/Test/More/DeepCheck/Tolerant.pm index ef3fb45..793b4c0 100644 --- a/cpan/Test-Simple/lib/Test/More/DeepCheck/Tolerant.pm +++ b/cpan/Test-Simple/lib/Test/More/DeepCheck/Tolerant.pm @@ -220,6 +220,10 @@ sub _hash_check { __END__ +=pod + +=encoding UTF-8 + =head1 NAME Test::More::DeepCheck::Tolerant - Under the hood implementation of @@ -229,8 +233,6 @@ mostly_like() This is where L<Test::MostlyLike> is implemented. -=encoding utf8 - =head1 SOURCE The source code repository for Test::More can be found at diff --git a/cpan/Test-Simple/lib/Test/More/Tools.pm b/cpan/Test-Simple/lib/Test/More/Tools.pm index 554b3d9..1fea46f 100644 --- a/cpan/Test-Simple/lib/Test/More/Tools.pm +++ b/cpan/Test-Simple/lib/Test/More/Tools.pm @@ -17,6 +17,19 @@ sub tmt() { __PACKAGE__ } my %CMP_OK_BL = map { ( $_, 1 ) } ( "=", "+=", ".=", "x=", "^=", "|=", "||=", "&&=", "..."); my %NUMERIC_CMPS = map { ( $_, 1 ) } ( "<", "<=", ">", ">=", "==", "!=", "<=>" ); +sub _cmp_eval { + my ($line, $name, $file, $got, $type, $expect) = @_; + my $test; + # This is so that warnings come out at the caller's level + ## no critic (BuiltinFunctions::ProhibitStringyEval) + eval qq[ +#line $line "(eval in $name) $file" +\$test = (\$got $type \$expect); +1; + ] || die $@; + return $test; +} + sub cmp_check { my($class, $got, $type, $expect) = @_; @@ -31,13 +44,7 @@ sub cmp_check { my $test = 0; my ($success, $error) = try { - # This is so that warnings come out at the caller's level - ## no critic (BuiltinFunctions::ProhibitStringyEval) - eval qq[ -#line $line "(eval in $name) $file" -\$test = (\$got $type \$expect); -1; - ] || die $@; + $test = _cmp_eval($line, $name, $file, $got, $type, $expect); }; my @diag; @@ -326,6 +333,10 @@ DIAGNOSTIC __END__ +=pod + +=encoding UTF-8 + =head1 NAME Test::More::Tools - Generic form of tools from Test::More. @@ -396,8 +407,6 @@ Regex compare. C<$op> may be C<=~> or C<!~>. =back -=encoding utf8 - =head1 SOURCE The source code repository for Test::More can be found at diff --git a/cpan/Test-Simple/lib/Test/MostlyLike.pm b/cpan/Test-Simple/lib/Test/MostlyLike.pm index 76c6c47..8831609 100644 --- a/cpan/Test-Simple/lib/Test/MostlyLike.pm +++ b/cpan/Test-Simple/lib/Test/MostlyLike.pm @@ -36,6 +36,9 @@ WARNING 1; __END__ +=pod + +=encoding UTF-8 =head1 NAME @@ -189,8 +192,6 @@ Sometimes you want to ignore the methods and get the hash value directly. mostly_like($got, $exp, "Did not call the fatal method"); -=encoding utf8 - =head1 SOURCE The source code repository for Test::More can be found at diff --git a/cpan/Test-Simple/lib/Test/Simple.pm b/cpan/Test-Simple/lib/Test/Simple.pm index b3de80e..3ab5693 100644 --- a/cpan/Test-Simple/lib/Test/Simple.pm +++ b/cpan/Test-Simple/lib/Test/Simple.pm @@ -5,10 +5,10 @@ use 5.008001; use strict; use warnings; -our $VERSION = '1.301001_097'; +our $VERSION = '1.301001_098'; $VERSION = eval $VERSION; ## no critic (BuiltinFunctions::ProhibitStringyEval) -use Test::Stream 1.301001_097 '-internal'; +use Test::Stream 1.301001_098 '-internal'; use Test::Stream::Toolset; use Test::Stream::Exporter; @@ -61,6 +61,10 @@ sub ok ($;$) { ## no critic (Subroutines::ProhibitSubroutinePrototypes) __END__ +=pod + +=encoding UTF-8 + =head1 NAME Test::Simple - Basic utilities for writing tests. @@ -234,9 +238,6 @@ programs and things will still work). Look in L<Test::More>'s SEE ALSO for more testing modules. - -=encoding utf8 - =head1 SOURCE The source code repository for Test::More can be found at diff --git a/cpan/Test-Simple/lib/Test/Stream.pm b/cpan/Test-Simple/lib/Test/Stream.pm index 799b553..1c05f1d 100644 --- a/cpan/Test-Simple/lib/Test/Stream.pm +++ b/cpan/Test-Simple/lib/Test/Stream.pm @@ -2,7 +2,7 @@ package Test::Stream; use strict; use warnings; -our $VERSION = '1.301001_097'; +our $VERSION = '1.301001_098'; $VERSION = eval $VERSION; ## no critic (BuiltinFunctions::ProhibitStringyEval) use Test::Stream::Context qw/context/; @@ -404,7 +404,8 @@ sub done_testing { return; } - $ctx->plan($num || $plan || $ran) unless $state->[STATE_PLAN]; + # Use _plan to bypass Test::Builder::plan() monkeypatching + $ctx->_plan($num || $plan || $ran) unless $state->[STATE_PLAN]; if ($plan && $plan != $ran) { $state->[STATE_PASSING] = 0; @@ -743,6 +744,10 @@ sub STORABLE_thaw { __END__ +=pod + +=encoding UTF-8 + =head1 NAME Test::Stream - A modern infrastructure for testing. @@ -1080,8 +1085,6 @@ restored to the previous state. =back -=encoding utf8 - =head1 SOURCE The source code repository for Test::More can be found at diff --git a/cpan/Test-Simple/lib/Test/Stream/API.pm b/cpan/Test-Simple/lib/Test/Stream/API.pm index 68b1e55..0253081 100644 --- a/cpan/Test-Simple/lib/Test/Stream/API.pm +++ b/cpan/Test-Simple/lib/Test/Stream/API.pm @@ -116,6 +116,10 @@ sub get_tap_outputs { __END__ +=pod + +=encoding UTF-8 + =head1 NAME Test::Stream::API - Single point of access to Test::Stream extendability @@ -533,10 +537,17 @@ already a tester it will return the existing meta-object. =item $context = context() +=item $context = context($add_level) + This will get the correct L<Test::Stream::Context> object. This may be one that was previously initialized, or it may generate a new one. Read the L<Test::Stream::Context> documentation for more info. +Note, C<context()> assumes you are at the lowest level of your tool, and looks +at the current caller. If you need it to look further you can call it with a +numeric argument which is added to the level. To clarify, calling C<context()> +is the same as calling C<context(0)>. + =item $stream = current_stream() This will return the current L<Test::Stream> Object. L<Test::Stream> objects @@ -586,8 +597,6 @@ Check if the test state is passing. =back -=encoding utf8 - =head1 SOURCE The source code repository for Test::More can be found at diff --git a/cpan/Test-Simple/lib/Test/Stream/Architecture.pod b/cpan/Test-Simple/lib/Test/Stream/Architecture.pod index b67fe7e..84aec12 100644 --- a/cpan/Test-Simple/lib/Test/Stream/Architecture.pod +++ b/cpan/Test-Simple/lib/Test/Stream/Architecture.pod @@ -1,3 +1,7 @@ +=pod + +=encoding UTF-8 + =head1 NAME Test::Stream::Architecture - overview of how the Test-More dist works. @@ -350,8 +354,6 @@ Test::Stream, and then all events get intercepted by that subtest. When the subtest is done, issue another Child event to close it out. Once closed, a Subtest event will be generated for you and sent to the stream. -=encoding utf8 - =head1 SOURCE The source code repository for Test::More can be found at diff --git a/cpan/Test-Simple/lib/Test/Stream/ArrayBase.pm b/cpan/Test-Simple/lib/Test/Stream/ArrayBase.pm index 1be5569..6ac75de 100644 --- a/cpan/Test-Simple/lib/Test/Stream/ArrayBase.pm +++ b/cpan/Test-Simple/lib/Test/Stream/ArrayBase.pm @@ -97,6 +97,10 @@ sub to_hash { __END__ +=pod + +=encoding UTF-8 + =head1 NAME Test::Stream::ArrayBase - Base class for classes that use an arrayref instead @@ -270,8 +274,6 @@ beyond reason. A large part of the slowdown was due to the use of proper methods instead of directly accessing elements. We also switched to using a LOT more objects that have methods. -=encoding utf8 - =head1 SOURCE The source code repository for Test::More can be found at diff --git a/cpan/Test-Simple/lib/Test/Stream/ArrayBase/Meta.pm b/cpan/Test-Simple/lib/Test/Stream/ArrayBase/Meta.pm index a283afd..159807c 100644 --- a/cpan/Test-Simple/lib/Test/Stream/ArrayBase/Meta.pm +++ b/cpan/Test-Simple/lib/Test/Stream/ArrayBase/Meta.pm @@ -119,6 +119,10 @@ sub add_accessors { __END__ +=pod + +=encoding UTF-8 + =head1 NAME Test::Stream::ArrayBase::Meta - Meta Object for ArrayBase objects. @@ -181,8 +185,6 @@ C<uc($name)> constant. =back -=encoding utf8 - =head1 SOURCE The source code repository for Test::More can be found at diff --git a/cpan/Test-Simple/lib/Test/Stream/Carp.pm b/cpan/Test-Simple/lib/Test/Stream/Carp.pm index 36a5ee8..6ec6a15 100644 --- a/cpan/Test-Simple/lib/Test/Stream/Carp.pm +++ b/cpan/Test-Simple/lib/Test/Stream/Carp.pm @@ -15,6 +15,10 @@ Test::Stream::Exporter->cleanup; __END__ +=pod + +=encoding UTF-8 + =head1 NAME Test::Stream::Carp - Delayed Carp loader. @@ -41,8 +45,6 @@ See L<Carp> for details on each of these functions. =back -=encoding utf8 - =head1 SOURCE The source code repository for Test::More can be found at diff --git a/cpan/Test-Simple/lib/Test/Stream/Context.pm b/cpan/Test-Simple/lib/Test/Stream/Context.pm index d2aaf10..b4215db 100644 --- a/cpan/Test-Simple/lib/Test/Stream/Context.pm +++ b/cpan/Test-Simple/lib/Test/Stream/Context.pm @@ -462,6 +462,10 @@ sub AUTOLOAD { __END__ +=pod + +=encoding UTF-8 + =head1 NAME Test::Stream::Context - Object to represent a testing context. @@ -503,6 +507,11 @@ context matters a lot. If you want to store a context for later reference use the C<snapshot()> method to get a clone of it that is safe to store anywhere. +Note, C<context()> assumes you are at the lowest level of your tool, and looks +at the current caller. If you need it to look further you can call it with a +numeric argument which is added to the level. To clarify, calling C<context()> +is the same as calling C<context(0)>. + =back =head1 METHODS @@ -623,8 +632,6 @@ is a reliable way to set a global todo that effects any/all packages. =back -=encoding utf8 - =head1 SOURCE The source code repository for Test::More can be found at diff --git a/cpan/Test-Simple/lib/Test/Stream/Event.pm b/cpan/Test-Simple/lib/Test/Stream/Event.pm index e814205..2080597 100644 --- a/cpan/Test-Simple/lib/Test/Stream/Event.pm +++ b/cpan/Test-Simple/lib/Test/Stream/Event.pm @@ -80,6 +80,10 @@ sub subevents { } __END__ +=pod + +=encoding UTF-8 + =head1 NAME Test::Stream::Event - Base class for events @@ -301,8 +305,6 @@ The skip message if the event was generated via skip. =back -=encoding utf8 - =head1 SOURCE The source code repository for Test::More can be found at diff --git a/cpan/Test-Simple/lib/Test/Stream/Event/Bail.pm b/cpan/Test-Simple/lib/Test/Stream/Event/Bail.pm index 4164d55..4b50c63 100644 --- a/cpan/Test-Simple/lib/Test/Stream/Event/Bail.pm +++ b/cpan/Test-Simple/lib/Test/Stream/Event/Bail.pm @@ -28,6 +28,10 @@ sub extra_details { __END__ +=pod + +=encoding UTF-8 + =head1 NAME Test::Stream::Event::Bail - Bailout! @@ -81,8 +85,6 @@ Boolean, true if the bailout should be quiet. =back -=encoding utf8 - =head1 SOURCE The source code repository for Test::More can be found at diff --git a/cpan/Test-Simple/lib/Test/Stream/Event/Diag.pm b/cpan/Test-Simple/lib/Test/Stream/Event/Diag.pm index 0e12c0c..365a986 100644 --- a/cpan/Test-Simple/lib/Test/Stream/Event/Diag.pm +++ b/cpan/Test-Simple/lib/Test/Stream/Event/Diag.pm @@ -13,7 +13,12 @@ use Test::Stream::Carp qw/confess/; sub init { $_[0]->SUPER::init(); - $_[0]->[MESSAGE] = 'undef' unless defined $_[0]->[MESSAGE]; + if (defined $_[0]->[MESSAGE]) { + $_[0]->[MESSAGE] .= ""; + } + else { + $_[0]->[MESSAGE] = 'undef'; + } weaken($_[0]->[LINKED]) if $_[0]->[LINKED]; } @@ -48,12 +53,14 @@ sub extra_details { __END__ +=pod + +=encoding UTF-8 + =head1 NAME Test::Stream::Event::Diag - Diag event type -=encoding utf8 - =head1 DESCRIPTION Diagnostics messages, typically rendered to STDERR. diff --git a/cpan/Test-Simple/lib/Test/Stream/Event/Finish.pm b/cpan/Test-Simple/lib/Test/Stream/Event/Finish.pm index 2f181a9..0617e5f 100644 --- a/cpan/Test-Simple/lib/Test/Stream/Event/Finish.pm +++ b/cpan/Test-Simple/lib/Test/Stream/Event/Finish.pm @@ -18,6 +18,10 @@ sub extra_details { __END__ +=pod + +=encoding UTF-8 + =head1 NAME Test::Stream::Event::Finish - The finish event type @@ -26,8 +30,6 @@ Test::Stream::Event::Finish - The finish event type Sent after testing is finished. -=encoding utf8 - =head1 SOURCE The source code repository for Test::More can be found at diff --git a/cpan/Test-Simple/lib/Test/Stream/Event/Note.pm b/cpan/Test-Simple/lib/Test/Stream/Event/Note.pm index 263b08c..6d39548 100644 --- a/cpan/Test-Simple/lib/Test/Stream/Event/Note.pm +++ b/cpan/Test-Simple/lib/Test/Stream/Event/Note.pm @@ -11,7 +11,12 @@ use Test::Stream::Carp qw/confess/; sub init { $_[0]->SUPER::init(); - $_[0]->[MESSAGE] = 'undef' unless defined $_[0]->[MESSAGE]; + if (defined $_[0]->[MESSAGE]) { + $_[0]->[MESSAGE] .= ""; + } + else { + $_[0]->[MESSAGE] = 'undef'; + } } sub to_tap { @@ -33,12 +38,14 @@ sub extra_details { __END__ +=pod + +=encoding UTF-8 + =head1 NAME Test::Stream::Event::Note - Note event type -=encoding utf8 - =head1 DESCRIPTION Notes, typically rendered to STDOUT. diff --git a/cpan/Test-Simple/lib/Test/Stream/Event/Ok.pm b/cpan/Test-Simple/lib/Test/Stream/Event/Ok.pm index 2390638..e4e9c03 100644 --- a/cpan/Test-Simple/lib/Test/Stream/Event/Ok.pm +++ b/cpan/Test-Simple/lib/Test/Stream/Event/Ok.pm @@ -200,12 +200,14 @@ sub extra_details { __END__ +=pod + +=encoding UTF-8 + =head1 NAME Test::Stream::Event::Ok - Ok event type -=encoding utf8 - =head1 DESCRIPTION Ok events are generated whenever you run a test that produces a result. diff --git a/cpan/Test-Simple/lib/Test/Stream/Event/Plan.pm b/cpan/Test-Simple/lib/Test/Stream/Event/Plan.pm index 7467b99..f3712b2 100644 --- a/cpan/Test-Simple/lib/Test/Stream/Event/Plan.pm +++ b/cpan/Test-Simple/lib/Test/Stream/Event/Plan.pm @@ -65,12 +65,14 @@ sub extra_details { __END__ +=pod + +=encoding UTF-8 + =head1 NAME Test::Stream::Event::Plan - The event of a plan -=encoding utf8 - =head1 DESCRIPTION Plan events are fired off whenever a plan is declared, done testing is called, diff --git a/cpan/Test-Simple/lib/Test/Stream/Event/Subtest.pm b/cpan/Test-Simple/lib/Test/Stream/Event/Subtest.pm index ce6ec32..13ae97e 100644 --- a/cpan/Test-Simple/lib/Test/Stream/Event/Subtest.pm +++ b/cpan/Test-Simple/lib/Test/Stream/Event/Subtest.pm @@ -124,6 +124,10 @@ sub extra_details { __END__ +=pod + +=encoding UTF-8 + =head1 NAME Test::Stream::Event::Subtest - Subtest event @@ -194,8 +198,6 @@ Number of tests that failed inside the subtest. =back -=encoding utf8 - =head1 SOURCE The source code repository for Test::More can be found at diff --git a/cpan/Test-Simple/lib/Test/Stream/ExitMagic.pm b/cpan/Test-Simple/lib/Test/Stream/ExitMagic.pm index 7f5bf5b..791ba14 100644 --- a/cpan/Test-Simple/lib/Test/Stream/ExitMagic.pm +++ b/cpan/Test-Simple/lib/Test/Stream/ExitMagic.pm @@ -153,6 +153,10 @@ sub be_helpful_magic { __END__ +=pod + +=encoding UTF-8 + =head1 NAME Test::Stream::ExitMagic - Encapsulate the magic exit logic @@ -165,8 +169,6 @@ It's magic! well kinda.. Don't use this yourself, let L<Test::Stream> handle it. -=encoding utf8 - =head1 SOURCE The source code repository for Test::More can be found at diff --git a/cpan/Test-Simple/lib/Test/Stream/ExitMagic/Context.pm b/cpan/Test-Simple/lib/Test/Stream/ExitMagic/Context.pm index babad93..9832a68 100644 --- a/cpan/Test-Simple/lib/Test/Stream/ExitMagic/Context.pm +++ b/cpan/Test-Simple/lib/Test/Stream/ExitMagic/Context.pm @@ -19,6 +19,10 @@ sub from_end_block { 1 }; __END__ +=pod + +=encoding UTF-8 + =head1 NAME Test::Stream::ExitMagic::Context - Special context for use in an END block. @@ -32,8 +36,6 @@ trivial one is used instead. B<DO NOT USE THIS>. If you find yourself thinking that you should use this then B<STOP!> because you are very likely to be wrong. -=encoding utf8 - =head1 SOURCE The source code repository for Test::More can be found at diff --git a/cpan/Test-Simple/lib/Test/Stream/Explanation.pod b/cpan/Test-Simple/lib/Test/Stream/Explanation.pod new file mode 100644 index 0000000..9314bb6 --- /dev/null +++ b/cpan/Test-Simple/lib/Test/Stream/Explanation.pod @@ -0,0 +1,943 @@ +package Test::Stream::Explanation; + +=pod + +=encoding UTF-8 + +=head1 NAME + +Test::Stream::Explanation - Explanation of all things Test::Stream + +=head1 Summary of problems the new internals solve + +=over 4 + +=item Monolithic singleton + +=item Subtests are a horrible hack + +=item No event monitoring/munging + +=item Diags and Oks are not linked + +=item $Level is fragile, non-obvious, and actively harmful + +=item Depth ($Level) is a bad thing to test against + +=item There is no good way to validate testing tools, only mediocre ways + +=item Cannot reuse Test::More tools without generating TAP + +=item TAP is mandatory + +=item Setting the encoding requires major hackery + +=item No forking support + +=item Shared variable hackery in thread support + +=back + +=head1 Solutions + +=head2 Singleton + +The biggest problem with Test::Builder is that it does 2 things at once. The +first thing it does is synchronization, which is accomplished by making it a +singleton. The second thing it does is provide a collection of useful tools and +shortcuts for generating events. This is an issue because the tools are tied to +the singleton, Subclassing Test::Builder is not an option, and there are few +hooks. You essentially have to hack the Test::Builder object, and hope nobody +else does the same. + +Test::Stream now houses synchronization code, all events come to Test::Stream, +which makes sure the state is updated, and then forwards the events to where +they need to be, including producing the TAP output. This module synchronizes +state, threads, processes, and events. + +Unlike Test::Builder, Test::Stream is not a true singleton. Test::Stream has a +singleton stack, and code always uses the instance at the top of the stack. +This allows you to temporarily push an instance to the top in order to +intercept events. + +Anything not essential to synchronization is kept in other modules. This model +allows you to subclass tools as you see fit. You can create and destroy +instances as needed. You can create your own toolboxes without accounting for +the nature of a singleton. + +=head2 Subtests + +Do not read the subtest implementation in the legacy Test::Builder code, if +your eyes bleed that much you won't be able to finish reading this document. +They first copy the singleton, then reset the originals internals, do their +thing, then restore the original internals. This is not an attack against the +people that wrote it; they did the best that could be done with the singleton +they had to work with. The only way to write a better implementation is to move +away from the monolithic singleton model. + +Subtests are now integrated into the design of Test::Stream. Test::Stream +maintains a state stack. When a subtest starts it pushes a new state to the top +of the stack, when it is finished it pops the state. Designing the internals +with subtests in mind from the beginning significantly reduces the hackery +necessary to make them work. + +Note: There is still some other stuff that makes subtests non-trivial, such as +TODO inheritance. But most of the problems related to subtests are solved in +much saner ways now. + +=head2 Event Handling + +In Test::Builder, ok, diag, note, etc. were all simply methods. You call the +method you get some TAP. There was no easy way to hook into the system and +modify an event. There is also no easy way to listen for events, or maintain a +complete list, short of parsing TAP. + +All "events" are now proper objects. Tools generate events such as 'ok' and +'diag', then send them to the Test::Stream instance at the top of the stack. +Test::Stream provides hooks for you to modify events before the test state is +updated, as well as hooks for reading/displaying/storing events after the state +is updated. There is also a hook for the end of the test run (done_testing, or +test ended). + +This is what Test::Stream is named Test::Stream, all events stream from the +tools into the Test::Stream funnel, which then gets them where they need to go. +Previously these kinds of actions required monkeypatching. + +=head2 Linking ok and diag + +Tools would typically call C<< $TB->ok >>, then call C<< $TB->diag >>. Both +would produce output. There is no easy way to associate the diag and the ok. +Often the messages can appear out of order, or far apart. Usually a human can +figure out what goes where, but connecting them programmatically is very hard +to do after the fact. + +Diags and oks can still exist as independent events, but by default all Test::More +tools link the 'ok' and 'diag' events they produce. This allows code to process +the ok and attached diagnostics as one unit. This prevents guess work +previously required to accomplish this. Any downstream tool can also link 'ok' +and 'diag' objects, but they are not required to do so for compatibility +reasons. + +NOTE: Once the events are turned into TAP they still have the same issue as +before, TAP itself does not provide any way of linking the diag and the ok. + +=head2 $Level + +=head3 Whats the problem with $Level? + + local $Test::Builder::Level = $Test::Builder::Level + $x; + +At a glance the code above seems reasonable... But there are caveats: + +=over 4 + +=item What if you have multiple Test::Builder instances? + +Don't + +=item What about subtests? + +$Level is zeroed out and restored later. + +=item What if my unit tests validate the value of $Level, but Test::Builder adds another layer? + +Test::Builder can never break large subs into small ones for this reason. Or +better yet, don't use Test::Tester since you have to jump through hoops for it +to skip testing level. + +=item This is a non-obvious interface for new perl developers. + +This code requires you to know about local, package variables, and scope. In +some cases you also need to do math, something better left to the computer. + +=back + +=head3 How is it solved? + +L<Test::Stream::Context> + +Instead of bumping $Level, you ask for a $context instance. You normally ask +for the $context at the shallowest level of your tools code. The context +figures out what file+line errors should be reported to, as well as recording +other critical per-test state such as TODO. + +Once you obtain a context, anything else that asks for the context will find +the one you already have. Once nothing is holding a reference to the context, a +new one can be generated. Essentially this lets the first tool in the stack +lock in a context, and all deeper tools find it. When your tool is finished the +Context is destroyed allowing the next tool to repeat the process. This lets +you stack tools arbitrarily without concerning yourself with depth value. + +Note: You can pass a level/depth value when obtaining a context if for some +reason you cannot obtain it at the shallowest level. + +Note: Context takes the value of $Level into account for compatibility reasons. +Backcompat like this adds an unfortunate level of complexity to Context. + +=head2 Validating test tools + +Test::Builder::Tester simply captures all output from Test::Builder. Your job +is to compare the strings it intercepts with the strings you expect. There are +a few helpers to reduce the tedious nature of these string compares, but +ultimately they are not very flexible. Changing the indentation of a comment +intended for human consumption can break any and all modules that use +Test::Builder::Tester. + +Test::Tester is a huge improvement, but lacks support for numerous features. +Test::Tester also works (worked) by replacing the singleton and monkeypatching +a lot of methods. Testing tools that also need to monkeypatch is not possible. +In addition it made too many assumptions about what you wanted to do with the +results it found. + +The solution here is Test::Stream::Tester. Test::Stream::Tester leverages the +stack nature of Test::Stream to intercept events generated over a specific +scope. These event objects can then be verified using well known tools from +Test::More, or the tools Test::Stream::Tester itself provides to make +validating events super easy. + +Another validation problem solved here is that you can filter, or be selective +about what events you care about. This allows you to test only the parts that +your module generates. This is helpful in ensuring changes upstream do not +break your tests unless they actually break your modules behavior. + +=head2 Resusable Test::More tools. + +Often people would write test subs that make use of tools such as C<like>, +C<is_deeply>, and others in a sequence to validate a single result. This +produces an 'ok' and/or diag for each tool used. In many cases people would +prefer to produce only a single final event, and a combined diagnostic message. +This is now possible. + +L<Test::More::Tools> and L<Test::More::DeepCheck> solve this problem. Nearly +all the internals of Test::More have been moved into these 2 modules. The subs +in these modules return a boolean and diagnostics messages, but do not fire off +events. These are then wrapped in Test::More to actually produce the events. +Using these tools you can create composite tools that produce a single event. + +L<Test::More::DeepCheck> is the base for is_deeply. This is useful because it +gives you a chance to create tools like is_deeply with similar diagnostics (for +better or worse). An example of this is L<Test::MostlyLike>. + +=head2 Mandatory TAP. + +99% of the time you want TAP. With the old internals turning TAP off was hard, +and usually resulted in a useless Test::Builder. + +There is now a single switch you can use to turn TAP on and off. The listener +feature of Test::Stream gives you the ability to produce whatever output you +desire for any event that comes along. All the test state is still kept +properly. + +=head2 Setting the encoding + +Legacy Test::Builder would clone the standard filehandles, reset them, and +modify them in various ways as soon as it loaded. Changes made to STDERR and +STDOUT after this action would have no effect on Test::Builder. You could +modify/set/reset Test::Builders filehandles, but this was not obvious. Setting +the encoding of the handles in Test::Builder could also be dangerous as other +modules might have changes the handles. + +For compatibility reasons Test::Stream still has to do all the filehandle +manipulation Test::Builder did. However it encapsulates it better and makes it +significantly easier to modify. Every class that produces events gets a +meta-object. The meta-object has an option for encoding. You can ask for a +specific encoding when you load Test::More, or you can change it at any point +in the test. + +Encodings are managed by <Test::Stream::IOSets>. Each Test::Stream instance has +an instance of L<Test::Stream::IOSets>. The default encoding is called 'legacy' +and it does what Test::Builder has always done. You can ask for a specific +encoding, such as utf8, and IOSets will create a new clone of STDERR and STDOUT +and handle setting the encoding for you. IOSets can manage several encodings +all at once, so you can switch as necessary in your tests, or have multiple +tests under the same process that use different encodings. + +=head2 Threads and Forking + +Legacy Test::Builder does not support producing results from multiple threads +without serious hacking or questionable third party modules (Of which I own +one, and help maintain another). + +Legacy Test::Builder does support threading, but only if threads are loaded +first. It uses shared variables and locking to maintain the test state and +ensure test numbers are consistent. + +Test::Stream has forking support baked in (though you have to ask for it). +Thread support has been changed to use the same mechanism as forking support. +There are no shared variables. Test::Stream implements checks to ensure that +all events generated get funneled to the parent process/thread where they can +then be properly processed. + +=head1 Module justifications + +All code is a liability. Any module which is included in the dist requires +some justification. If there is no justification for including the module the +sensible thing to do would be to purge it. + +=head2 Test::Builder + +Required for legacy support and backwards compatibility. + +=head2 Test::Builder::Module + +Required for legacy support and backwards compatibility. In the past people +were urged to use this as a base class for all testing tools. To my knowledge +adoption was very low. + +=head2 Test::Builder::Tester + +Has been included for many years. Tightly coupled with the rest of the testing +tools. Wide adoption. + +=head3 Additional components + +=over 4 + +=item Test::Builder::Tester::Color + +=back + +=head2 Test::CanFork + +Encapsulation of some logic that used to be duplicated in several Test-Simple +tests. Now usable by anyone. + +This module lets you make a test conditional upon support for forking. + +=head2 Test::CanThread + +Encapsulation of some logic that used to be duplicated in several Test-Simple +tests. Now usable by anyone. + +This module lets you make a test conditional upon support for threads. + +=head2 Test::More + +This requires no justification. + +=head3 Additional components + +=over 4 + +=item Test::More::DeepCheck + +This is a base class for tools that resemble is_deeply. A lot of this is +valuable logic that is now reusable. + +=item Test::More::DeepCheck::Strict + +This is the subclass that implements is_Deeply itself. I will not that this was +a refactor, not a re-implementation, there should be zero net-change to how +is_deeply behaves. + +=item Test::More::Tools + +This is where the guts of Test::More tools live. This is here so that they can +be reused in composite tests without any hacking. This was a refactor, not +redesign from the ground up. + +=back + +=head2 Test::MostlyLike + +This implements a new tool similar to is_deeply called mostly_like. This is +included in the dist because I wrote it specifically to test the Test-Simple +internals. It is also useful enough to publish publicly. + +=head3 Additional components + +=over 4 + +=item Test::More::DeepCheck::Tolerant + +This is the subclass that implements mostly_like. + +=back + +=head2 Test::Simple + +This requires no justification. This is also the module the dist is named after. + +=head2 Test::Stream + +This is the new crux of Test-Simple. + +Test::Stream is the hub to which all events flow. It is also responsible for +ensuring all events get to the correct place. This is where all synchronization +happens. + +=head3 Additional components + +=over 4 + +=item Test::Stream::API + +This is sugar-coating. This is the go-to place when people wish to know the +easiest way to accomplish something fancy. + +=item Test::Stream::Meta + +Metadata assigned to test files/packages + +=item Test::Stream::PackageUtil + +Utilities for inspecting package internals + +=item Test::Stream::Subtest + +Encapsulation of subtest logic + +=item Test::Stream::Threads + +Encapsulation of threading tools + +=item Test::Stream::Util + +Misc Utilities used all over Test-Simple + +=back + +=head2 Test::Stream::ArrayBase + +All objects in Test::Stream use this to generate methods and constructors. This +is done here, and the way it is, for performance. Before implementing this ans +switching to it, performance was bad enough to keep the new internals out of +core. + +=head3 Additional components + +=over 4 + +=item Test::Stream::ArrayBase::Meta + +=back + +=head2 Test::Stream::Block + +Subtests are typically codeblocks. This is an object to represent them. There +is some development in this module that will provide profoundly useful +debugging for subtests, though it has not yet been enabled. This module is in +the dist mainly to give it a shakedown and prove it before turning on the extra +debugging. + +=head2 Test::Stream::Carp + +We cannot load Carp until we actually need it, if we do it can cause unexpected +test passes downstream. This is one of few core modules I am willing to do this +for, mainly because legacy had the same policy. + +This module provides the same tools as Carp, they simple load Carp and call the +correct sub from there. + +=head2 Test::Stream::Context + +This module is responsible for gathering details about events that are to be +generated. It is responsible for figuring out where errors should be reported, +if we are in a TODO, and various other meta-data. + +This module is an essential module. + +It also handles backwards compatibility with $Level, $TODO, and +C<< Test::Builder->todo_start >>. + +=head2 Test::Stream::Event + +All 'events' are now proper objects, this is the base class for all events. + +=head3 Additional components + +=over 4 + +=item Test::Stream::Event::Bail + +Event for bailing out. + +=item Test::Stream::Event::Diag + +Event for diagnostics + +=item Test::Stream::Event::Finish + +Event for the end of the test. + +=item Test::Stream::Event::Note + +Event for notes. + +=item Test::Stream::Event::Ok + +The 'ok' event is the most well known. This is an essential event. + +=item Test::Stream::Event::Plan + +This event is triggered whenever a plan is declared. + +=item Test::Stream::Event::Subtest + +Subtests are their own event, it is a subclass of the +L<Test::Stream::Event::Ok> event. + +=back + +=head2 Test::Stream::ExitMagic + +This is where the magic that happens when a test process exists is +encapsulated. Some of this is pretty grody or questionable, nearly all of it is +here for legacy reasons. + +=head3 Additional components + +=over 4 + +=item Test::Stream::ExitMagic::Context + +Special Context object to use from ExitMagic. This is because a lot of Context +logic is a bad idea when run from an END block. + +=back + +=head2 Test::Stream::Exporter + +Test-Simple has to do a lot of exporting. Some of the exporting is not easy to +achieve using L<Exporter>. I can't use an export tool from cpan, so I had to +implement the bare minimum I needed here. + +=head3 Additional components + +=over 4 + +=item Test::Stream::Exporter::Meta + +=back + +=head2 Test::Stream::ForceExit + +This module is used to ensure that code exits by the end of a scope. This is +mainly for cases where you fork down stack from an eval and your code throws +and exception before it can exit. + +(A quick grep of the code tells me this is not in use anymore/yet. It can +probably be purged) + +=head2 Test::Stream::IOSets + +This is where filehandles and encodings are managed. This is here both to +implement legacy filehandle support, and to enable support for encodings. + +=head2 Test::Stream::Tester + +This module is intended to be the new and proper way to validate testing tools. +It supports all features of Test::Stream, and provides tools and helpers that +make the job easier. + +=head3 Additional components + +=over 4 + +=item Test::Stream::Tester::Checks + +=item Test::Stream::Tester::Checks::Event + +=item Test::Stream::Tester::Events + +=item Test::Stream::Tester::Events::Event + +=item Test::Stream::Tester::Grab + +=back + +=head2 Test::Stream::Toolset + +This module provides the minimum set of tools most test tools need to work. + +=head2 Test::Tester + +This is an important part of the ecosystem. It makes no sense to ship this +independently. Changes to Test-Simple can break this in any number of ways, +integration is the only sane option. + +=head3 Additional components + +Most of these remain for legacy support. + +=over 4 + +=item Test::Tester::Capture + +=item Test::Tester::CaptureRunner + +=item Test::Tester::Delegate + +=back + +=head2 Test::use::ok + +This module implements the sane companion to C<use_ok> which is C<use ok>. +There has been a desire to combine this into Test-Simple for years, I finally +did it. + +=head3 Additional components + +=over 4 + +=item ok + +This is where the actual implementation lives. + +=back + +=head1 Compatability Shims + +Some modules need to jump through extra hoops in order to support legacy code. +This section describes these instances. + +=head2 Test::Builder + +Nearly everything in this module is here purely for legacy and compatibility. +But there are some extra-notable items: + +=over 4 + +=item $_ORIG_Test + +=item %ORIG + +=item %WARNED + +These 3 variables are used to track and warn about changes to the singleton or +method monkeypatching that could cause problems. + +=item ctx() + +A special context method that does extra C<$Level> accounting. + +=item %TB15_METHODS + +=item AUTOLOAD + +Used to warn people when they appear to be using Test::Builder 1.5 methods that +never actually made it into production anywhere. + +=item underscore methods + +There are several private methods (underscore prefix) that were never intended +for external use. Despite underscores, warnings, and other such things people +used them externally anyway. Most were purged, but these were left because an +unbelievable amount of downstream things appear to depend on them. + +=back + +=head2 Test::Stream + +The state array has an extra field identified by the constant C<STATE_LEGACY>. +This is an array of all events of some types. Test::Builder used to maintain an +array of hashes representing events for inspection later. Code which relied on +this capability now depends on this and some translation logic in +Test::Builder. + +Unlike in old Test::Builder this feature can be turned off for performance and +memory improvement. + +=head2 Test::Stream::Util + +=over 4 + +=item is_dualvar + +Test::More has its own is_dualvar. This differs from Scalar::Utils dualvar +checker, enough to break cmp_ok. Because of the breakage I have not switched. + +=item is_regex + +Test::More tools check if things are regexes in many places. The way it does +this, and the things it considers to be regexes are suprising. Much of this is +due to VERY old code that might predate quick regexes. Switching away from this +would break a lot of things. + +=item unoverload + +Test::More has its own ideas of unoverloading things and when it is necessary. +Not safe to migrate away from this. + +=back + +=head2 Test::Stream::Context + +=over 4 + +=item TODO + +Has to look for todo in 4 places. $TODO in the test package, $TODO in +Test::More, the todo value of the Test::Builder singleton, and the todo in test +package meta-data. The main issue here is no good TODO system has ever been +found, so we use and support 4 mediocre or even bad ones. + +=item $Level + +Test::Builder has historically been very forgiving and clever when it comes to +$Level. Context takes $Level into account when finding the proper file + line +number for reporting errors. If $Level is wrong it attempts to be as forgiving +as Test::Builder was. Requiring $Level to be correct breaks an unfortunate +number of downstream tools, so we have to stay forgiving for now. + +=item Test::Builder monkeypatching + +When Test::Builder gets monkeypatched, we need to detect it here and try to +incorporate the monkeypatching. This is a horrible hack that works surprisingly +well. + +=item hide_todo + restore_todo + +Subtests need to hide the TODO state, they have always done this historically. +These methods accomplish this... for all 4 ways you can set TODO. + +=back + +=head2 Test::Stream::ExitMagic + +Test::Builder does a lot of stuff at exit. I would argue that a lot of this +should be harness logic. However compatibility and people relying on it means +we cannot just remove it all at once. + +This magic is called though either an END block, or done_testing. Sometimes +both. + +=head2 Test::Stream::IOSets + +Test::Builder clones STDERR and STDOUT and resets them to what it thinks they +should be. This encapsulates that logic and calls it 'legacy'. It then provides +mechanisms for actually supporting custom filehandles and encodings. + +=head2 Test::Tester + +This makes use of the STATE_LEGACY key mentioned in the Test::Stream section. +This also needs to do some gymnastics and monkeypatching for $Level support. + +=head1 Design Decisions + +=head2 Test::Builder + +Decided to turn this into a legacy wrapper. It is no longer essential for +anything new. + +=head2 Test::More + +Decided to refactor the logic out into reusable parts. No net change except for +some bug fixes. + +At one point some redesign was started, but it was abandoned, this mainly had +to do with use_ok and require_ok, which are horrible. + +=head3 Additional components + +Most logic was moved into these 3 modules + +=over 4 + +=item Test::More::DeepCheck + +is_deeply stack and diagnostics + +=item Test::More::DeepCheck::Strict + +is_deeply inner check functions + +=item Test::More::Tools + +Everything else. + +=back + +=head2 Test::Stream + +=over 4 + +=item Instead of a singleton, we have a stack of singletons + +We can't avoid using a singleton-like pattern when we are dealing with a shared +state. However there are times where we need to work around the singleton +model. The main example is writing tests for testing tools. The singleton stack +allows us to put new instances in place that will steal focus. + +Anything that produces events should send them to the topmost instance of +Test::Stream. Using tools like Test::Stream::Context and Test::Builder handle +this for you. + +In the old system you were expected to cache a copy of the Test::Builder +singleton, this caused problems when code needed to replace the singleton. +Subtests had to implement and ugly hack around this problem. In the new system +test state is also a stack, subtests work by pushing a new state, they do not +need to replace the entire singleton. + +=item Only state and synchronization is handled here + +Since this module is somewhat singleton in nature, we keep it as small as +possible. Anything that is put into a singleton-like object is hard to expand. +If it is not related to synchronization or common state, I tried to put it +somewhere else. + +=item Events are proper objects + +In the old design events were just methods that produced TAP. Now they are +proper objects that can be constructed, altered, passed around, etc. + +=item This module is a hub through which events stream + +Events are built by testing tools, once ready the events are given to +Test::Stream to ensure they get to the right place. + +=back + +=head2 Test::Stream::Meta + +Attaching meta-data to tests was a design decision adopted for settings that +people want, but might be different from test file to test file. Being able to +use different settings in different files is necessary for advanced testing +tools that might load multiple files at a time. Examples include Fennec, +Test::Class, etc. + +Currently TODO and tap_encoding are the only significant settings here. + +=head2 Test::Stream::ArrayBase + +This is the OO implementation used all over Test::Stream. The initial upgrade +to OO from a single object where hash elements were directly accessed resulted +in a significant slowdown. + +To avoid the slowdown a couple design decision were made: + +=over 4 + +=item Objects would be array based + +=item Constants would be used to access elements + +=item Single inheritance only for simplicity + +=item Seperate reader+writer methods + +=item generate methods for each attribute that use $_[xxx] and constants + +=back + +Together these designs resulted in huge performance gains. + +=head2 Test::Stream::Context + +The context object is created when a testing tool is called. Any testing tools +called within will find the existing context. This context stores important +things like test file, line number, etc. + +This is implemented as a weak singleton. When a tool gets a context is is +crated. When a tool returns the context is garbage collected and destroyed. +This allows the next tool to obtain a new context. + +=head2 Test::Stream::Event::Subtest + +The subtest event is a subclass of the ok event. This is done because a subtest +ultimately boils down to an 'ok'. + +=head2 Test::Stream::Exporter + +Test::Stream has to do some fancy exporting, specially due to +Test::Stream::ArrayBase and the attribute constants. This exporter is a very +light implementation modeled on Exporter::Declare. It uses a meta-object to +track exports. + +=head1 SOURCE + +The source code repository for Test::More can be found at +F<http://github.com/Test-More/test-more/>. + +=head1 MAINTAINER + +=over 4 + +=item Chad Granum E<lt>[email protected]<gt> + +=back + +=head1 AUTHORS + +The following people have all contributed to the Test-More dist (sorted using +VIM's sort function). + +=over 4 + +=item Chad Granum E<lt>[email protected]<gt> + +=item Fergal Daly E<lt>[email protected]>E<gt> + +=item Mark Fowler E<lt>[email protected]<gt> + +=item Michael G Schwern E<lt>[email protected]<gt> + +=item åé³³ + +=back + +=head1 COPYRIGHT + +There has been a lot of code migration between modules, +here are all the original copyrights together: + +=over 4 + +=item Test::Stream + +=item Test::Stream::Tester + +Copyright 2014 Chad Granum E<lt>[email protected]<gt>. + +This program is free software; you can redistribute it and/or +modify it under the same terms as Perl itself. + +See F<http://www.perl.com/perl/misc/Artistic.html> + +=item Test::Simple + +=item Test::More + +=item Test::Builder + +Originally authored by Michael G Schwern E<lt>[email protected]<gt> with much +inspiration from Joshua Pritikin's Test module and lots of help from Barrie +Slaymaker, Tony Bowden, blackstar.co.uk, chromatic, Fergal Daly and the perl-qa +gang. + +Idea by Tony Bowden and Paul Johnson, code by Michael G Schwern +E<lt>[email protected]<gt>, wardrobe by Calvin Klein. + +Copyright 2001-2008 by Michael G Schwern E<lt>[email protected]<gt>. + +This program is free software; you can redistribute it and/or +modify it under the same terms as Perl itself. + +See F<http://www.perl.com/perl/misc/Artistic.html> + +=item Test::use::ok + +To the extent possible under law, åé³³ has waived all copyright and related +or neighboring rights to L<Test-use-ok>. + +This work is published from Taiwan. + +L<http://creativecommons.org/publicdomain/zero/1.0> + +=item Test::Tester + +This module is copyright 2005 Fergal Daly <[email protected]>, some parts +are based on other people's work. + +Under the same license as Perl itself + +See http://www.perl.com/perl/misc/Artistic.html + +=item Test::Builder::Tester + +Copyright Mark Fowler E<lt>[email protected]<gt> 2002, 2004. + +This program is free software; you can redistribute it +and/or modify it under the same terms as Perl itself. + +=back diff --git a/cpan/Test-Simple/lib/Test/Stream/Exporter.pm b/cpan/Test-Simple/lib/Test/Stream/Exporter.pm index f02befd..237560a 100644 --- a/cpan/Test-Simple/lib/Test/Stream/Exporter.pm +++ b/cpan/Test-Simple/lib/Test/Stream/Exporter.pm @@ -132,6 +132,10 @@ sub default_exports { __END__ +=pod + +=encoding UTF-8 + =head1 NAME Test::Stream::Exporter - Declarative exporter for Test::Stream and friends. @@ -225,8 +229,6 @@ if the package has imported it. =head1 HOOKS -=encoding utf8 - =head1 SOURCE The source code repository for Test::More can be found at diff --git a/cpan/Test-Simple/lib/Test/Stream/Exporter/Meta.pm b/cpan/Test-Simple/lib/Test/Stream/Exporter/Meta.pm index 735a9af..0bdf935 100644 --- a/cpan/Test-Simple/lib/Test/Stream/Exporter/Meta.pm +++ b/cpan/Test-Simple/lib/Test/Stream/Exporter/Meta.pm @@ -126,6 +126,10 @@ sub get { __END__ +=pod + +=encoding UTF-8 + =head1 NAME Test::Stream::Exporter::Meta - Meta object for exporters. @@ -134,8 +138,6 @@ Test::Stream::Exporter::Meta - Meta object for exporters. L<Test::Stream::Exporter> uses this package to manage exports. -=encoding utf8 - =head1 SOURCE The source code repository for Test::More can be found at diff --git a/cpan/Test-Simple/lib/Test/Stream/ForceExit.pm b/cpan/Test-Simple/lib/Test/Stream/ForceExit.pm index e32edfb..32efb58 100644 --- a/cpan/Test-Simple/lib/Test/Stream/ForceExit.pm +++ b/cpan/Test-Simple/lib/Test/Stream/ForceExit.pm @@ -32,7 +32,7 @@ __END__ =head1 NAME -Test::ForceExit - Ensure C<exit()> is called bvy the end of a scope, force the issue. +Test::ForceExit - Ensure C<exit()> is called by the end of a scope, force the issue. =head1 DESCRIPTION diff --git a/cpan/Test-Simple/lib/Test/Stream/IOSets.pm b/cpan/Test-Simple/lib/Test/Stream/IOSets.pm index e2352ef..c76b675 100644 --- a/cpan/Test-Simple/lib/Test/Stream/IOSets.pm +++ b/cpan/Test-Simple/lib/Test/Stream/IOSets.pm @@ -108,6 +108,10 @@ sub _apply_layers { __END__ +=pod + +=encoding UTF-8 + =head1 NAME Test::Stream::IOSets - Manage sets of IO Handles in specific encodings. @@ -142,8 +146,6 @@ encoding. =back -=encoding utf8 - =head1 SOURCE The source code repository for Test::More can be found at diff --git a/cpan/Test-Simple/lib/Test/Stream/Meta.pm b/cpan/Test-Simple/lib/Test/Stream/Meta.pm index 9f7b6d3..68e6641 100644 --- a/cpan/Test-Simple/lib/Test/Stream/Meta.pm +++ b/cpan/Test-Simple/lib/Test/Stream/Meta.pm @@ -38,6 +38,10 @@ sub init_tester { __END__ +=pod + +=encoding UTF-8 + =head1 NAME Test::Stream::Meta - Meta object for unit test packages. @@ -101,8 +105,6 @@ These are various attributes stored on the meta object. =back -=encoding utf8 - =head1 SOURCE The source code repository for Test::More can be found at diff --git a/cpan/Test-Simple/lib/Test/Stream/PackageUtil.pm b/cpan/Test-Simple/lib/Test/Stream/PackageUtil.pm index f2a2a8c..03a8248 100644 --- a/cpan/Test-Simple/lib/Test/Stream/PackageUtil.pm +++ b/cpan/Test-Simple/lib/Test/Stream/PackageUtil.pm @@ -73,6 +73,10 @@ sub package_purge_sym { __END__ +=pod + +=encoding UTF-8 + =head1 NAME Test::Stream::PackageUtil - Utils for manipulating package symbol tables. @@ -107,8 +111,6 @@ name of the symbol to remove. =back -=encoding utf8 - =head1 SOURCE The source code repository for Test::More can be found at diff --git a/cpan/Test-Simple/lib/Test/Stream/Subtest.pm b/cpan/Test-Simple/lib/Test/Stream/Subtest.pm index 06016d2..97e274e 100644 --- a/cpan/Test-Simple/lib/Test/Stream/Subtest.pm +++ b/cpan/Test-Simple/lib/Test/Stream/Subtest.pm @@ -105,6 +105,10 @@ This is almost certainly not what you wanted. Did you fork and forget to exit? __END__ +=pod + +=encoding UTF-8 + =head1 Name Test::Stream::Subtest - Encapsulate subtest start, run, and finish. @@ -115,8 +119,6 @@ Test::Stream::Subtest - Encapsulate subtest start, run, and finish. subtest $name => sub { ... }; -=encoding utf8 - =head1 SOURCE The source code repository for Test::More can be found at diff --git a/cpan/Test-Simple/lib/Test/Stream/Tester.pm b/cpan/Test-Simple/lib/Test/Stream/Tester.pm index 91e9781..111dc73 100644 **** PATCH TRUNCATED AT 2000 LINES -- 833 NOT SHOWN **** -- Perl5 Master Repository
