diff --git a/perl-update-Module-Pluggable.patch b/perl-update-Module-Pluggable.patch new file mode 100644 index 0000000..56a28e5 --- /dev/null +++ b/perl-update-Module-Pluggable.patch @@ -0,0 +1,964 @@ +This patch is derived from the perl-5.10.1 tarball as released on the CPAN. + +diff -urN perl-5.10.0.orig/lib/Devel/InnerPackage.pm perl-5.10.0/lib/Devel/InnerPackage.pm +--- perl-5.10.0.orig/lib/Devel/InnerPackage.pm 2007-12-18 02:47:07.000000000 -0800 ++++ perl-5.10.0/lib/Devel/InnerPackage.pm 2009-08-31 19:47:24.444773931 -0700 +@@ -17,7 +17,7 @@ + =head1 SYNOPSIS + + use Foo::Bar; +- use Devel::innerPackage qw(list_packages); ++ use Devel::InnerPackage qw(list_packages); + + my @inner_packages = list_packages('Foo::Bar'); + +@@ -75,7 +75,7 @@ + !__PACKAGE__->_loaded($pack.$cand); # or @children; + push @packs, @children; + } +- return grep {$_ !~ /::::ISA::CACHE/} @packs; ++ return grep {$_ !~ /::(::ISA::CACHE|SUPER)/} @packs; + } + + ### XXX this is an inlining of the Class-Inspector->loaded() +diff -urN perl-5.10.0.orig/lib/Module/Pluggable/Object.pm perl-5.10.0/lib/Module/Pluggable/Object.pm +--- perl-5.10.0.orig/lib/Module/Pluggable/Object.pm 2007-12-18 02:47:07.000000000 -0800 ++++ perl-5.10.0/lib/Module/Pluggable/Object.pm 2009-08-31 19:47:24.446771196 -0700 +@@ -6,10 +6,9 @@ + use File::Spec::Functions qw(splitdir catdir curdir catfile abs2rel); + use Carp qw(croak carp); + use Devel::InnerPackage; +-use Data::Dumper; + use vars qw($VERSION); + +-$VERSION = '3.6'; ++$VERSION = '3.9'; + + + sub new { +@@ -20,6 +19,10 @@ + + } + ++### Eugggh, this code smells ++### This is what happens when you keep adding patches ++### *sigh* ++ + + sub plugins { + my $self = shift; +@@ -30,14 +33,14 @@ + my $filename = $self->{'filename'}; + my $pkg = $self->{'package'}; + ++ # Get the exception params instantiated ++ $self->_setup_exceptions; ++ + # automatically turn a scalar search path or namespace into a arrayref + for (qw(search_path search_dirs)) { + $self->{$_} = [ $self->{$_} ] if exists $self->{$_} && !ref($self->{$_}); + } + +- +- +- + # default search path is '::::Plugin' + $self->{'search_path'} = ["${pkg}::Plugin"] unless $self->{'search_path'}; + +@@ -46,13 +49,14 @@ + + + # check to see if we're running under test +- my @SEARCHDIR = exists $INC{"blib.pm"} && $filename =~ m!(^|/)blib/! ? grep {/blib/} @INC : @INC; ++ my @SEARCHDIR = exists $INC{"blib.pm"} && defined $filename && $filename =~ m!(^|/)blib/! ? grep {/blib/} @INC : @INC; + + # add any search_dir params + unshift @SEARCHDIR, @{$self->{'search_dirs'}} if defined $self->{'search_dirs'}; + + + my @plugins = $self->search_directories(@SEARCHDIR); ++ push(@plugins, $self->handle_innerpackages($_)) for @{$self->{'search_path'}}; + + # push @plugins, map { print STDERR "$_\n"; $_->require } list_packages($_) for (@{$self->{'search_path'}}); + +@@ -60,43 +64,12 @@ + return () unless @plugins; + + +- # exceptions +- my %only; +- my %except; +- my $only; +- my $except; +- +- if (defined $self->{'only'}) { +- if (ref($self->{'only'}) eq 'ARRAY') { +- %only = map { $_ => 1 } @{$self->{'only'}}; +- } elsif (ref($self->{'only'}) eq 'Regexp') { +- $only = $self->{'only'} +- } elsif (ref($self->{'only'}) eq '') { +- $only{$self->{'only'}} = 1; +- } +- } +- +- +- if (defined $self->{'except'}) { +- if (ref($self->{'except'}) eq 'ARRAY') { +- %except = map { $_ => 1 } @{$self->{'except'}}; +- } elsif (ref($self->{'except'}) eq 'Regexp') { +- $except = $self->{'except'} +- } elsif (ref($self->{'except'}) eq '') { +- $except{$self->{'except'}} = 1; +- } +- } +- + + # remove duplicates + # probably not necessary but hey ho + my %plugins; + for(@plugins) { +- next if (keys %only && !$only{$_} ); +- next unless (!defined $only || m!$only! ); +- +- next if (keys %except && $except{$_} ); +- next if (defined $except && m!$except! ); ++ next unless $self->_is_legit($_); + $plugins{$_} = 1; + } + +@@ -112,6 +85,58 @@ + + } + ++sub _setup_exceptions { ++ my $self = shift; ++ ++ my %only; ++ my %except; ++ my $only; ++ my $except; ++ ++ if (defined $self->{'only'}) { ++ if (ref($self->{'only'}) eq 'ARRAY') { ++ %only = map { $_ => 1 } @{$self->{'only'}}; ++ } elsif (ref($self->{'only'}) eq 'Regexp') { ++ $only = $self->{'only'} ++ } elsif (ref($self->{'only'}) eq '') { ++ $only{$self->{'only'}} = 1; ++ } ++ } ++ ++ ++ if (defined $self->{'except'}) { ++ if (ref($self->{'except'}) eq 'ARRAY') { ++ %except = map { $_ => 1 } @{$self->{'except'}}; ++ } elsif (ref($self->{'except'}) eq 'Regexp') { ++ $except = $self->{'except'} ++ } elsif (ref($self->{'except'}) eq '') { ++ $except{$self->{'except'}} = 1; ++ } ++ } ++ $self->{_exceptions}->{only_hash} = \%only; ++ $self->{_exceptions}->{only} = $only; ++ $self->{_exceptions}->{except_hash} = \%except; ++ $self->{_exceptions}->{except} = $except; ++ ++} ++ ++sub _is_legit { ++ my $self = shift; ++ my $plugin = shift; ++ my %only = %{$self->{_exceptions}->{only_hash}||{}}; ++ my %except = %{$self->{_exceptions}->{except_hash}||{}}; ++ my $only = $self->{_exceptions}->{only}; ++ my $except = $self->{_exceptions}->{except}; ++ ++ return 0 if (keys %only && !$only{$plugin} ); ++ return 0 unless (!defined $only || $plugin =~ m!$only! ); ++ ++ return 0 if (keys %except && $except{$plugin} ); ++ return 0 if (defined $except && $plugin =~ m!$except! ); ++ ++ return 1; ++} ++ + sub search_directories { + my $self = shift; + my @SEARCHDIR = @_; +@@ -121,7 +146,6 @@ + foreach my $dir (@SEARCHDIR) { + push @plugins, $self->search_paths($dir); + } +- + return @plugins; + } + +@@ -151,6 +175,8 @@ + # parse the file to get the name + my ($name, $directory, $suffix) = fileparse($file, $file_regex); + ++ next if (!$self->{include_editor_junk} && $self->_is_editor_junk($name)); ++ + $directory = abs2rel($directory, $sp); + + # If we have a mixed-case package name, assume case has been preserved +@@ -203,17 +229,34 @@ + # now add stuff that may have been in package + # NOTE we should probably use all the stuff we've been given already + # but then we can't unload it :( +- push @plugins, $self->handle_innerpackages($searchpath) unless (exists $self->{inner} && !$self->{inner}); ++ push @plugins, $self->handle_innerpackages($searchpath); + } # foreach $searchpath + + return @plugins; + } + ++sub _is_editor_junk { ++ my $self = shift; ++ my $name = shift; ++ ++ # Emacs (and other Unix-y editors) leave temp files ending in a ++ # tilde as a backup. ++ return 1 if $name =~ /~$/; ++ # Emacs makes these files while a buffer is edited but not yet ++ # saved. ++ return 1 if $name =~ /^\.#/; ++ # Vim can leave these files behind if it crashes. ++ return 1 if $name =~ /\.sw[po]$/; ++ ++ return 0; ++} ++ + sub handle_finding_plugin { + my $self = shift; + my $plugin = shift; + + return unless (defined $self->{'instantiate'} || $self->{'require'}); ++ return unless $self->_is_legit($plugin); + $self->_require($plugin); + } + +@@ -245,10 +288,11 @@ + + sub handle_innerpackages { + my $self = shift; ++ return () if (exists $self->{inner} && !$self->{inner}); ++ + my $path = shift; + my @plugins; + +- + foreach my $plugin (Devel::InnerPackage::list_packages($path)) { + my $err = $self->handle_finding_plugin($plugin); + #next if $err; +@@ -299,6 +343,14 @@ + + Optionally it instantiates those classes for you. + ++This object is wrapped by C. If you want to do something ++odd or add non-general special features you're probably best to wrap this ++and produce your own subclass. ++ ++=head1 OPTIONS ++ ++See the C docs. ++ + =head1 AUTHOR + + Simon Wistow +diff -urN perl-5.10.0.orig/lib/Module/Pluggable.pm perl-5.10.0/lib/Module/Pluggable.pm +--- perl-5.10.0.orig/lib/Module/Pluggable.pm 2007-12-18 02:47:07.000000000 -0800 ++++ perl-5.10.0/lib/Module/Pluggable.pm 2009-08-31 19:47:24.448771465 -0700 +@@ -9,7 +9,7 @@ + # Peter Gibbons: I wouldn't say I've been missing it, Bob! + + +-$VERSION = '3.6'; ++$VERSION = '3.9'; + + sub import { + my $class = shift; +@@ -60,8 +60,9 @@ + + + no strict 'refs'; +- no warnings 'redefine'; +- *{"$package\::$sub"} = $subroutine; ++ no warnings qw(redefine prototype); ++ ++ *{"$package\::$sub"} = $subroutine; + *{"$package\::search_path"} = $searchsub; + *{"$package\::only"} = $onlysub; + *{"$package\::except"} = $exceptsub; +@@ -297,6 +298,14 @@ + + file_regex => qr/\.plugin$/ + ++=head2 include_editor_junk ++ ++By default C ignores files that look like they were ++left behind by editors. Currently this means files ending in F<~> (~), ++the extensions F<.swp> or F<.swo>, or files beginning with F<.#>. ++ ++Setting C changes C so it does ++not ignore any files it finds. + + + =head1 METHODs +diff -urN perl-5.10.0.orig/MANIFEST perl-5.10.0/MANIFEST +--- perl-5.10.0.orig/MANIFEST 2007-12-18 02:47:07.000000000 -0800 ++++ perl-5.10.0/MANIFEST 2009-08-31 19:47:24.452770885 -0700 +@@ -3612,11 +3612,14 @@ + t/Module_Pluggable/09require.t Module::Pluggable tests + t/Module_Pluggable/10innerpack_inner.t Module::Pluggable tests + t/Module_Pluggable/10innerpack_noinner.t Module::Pluggable tests ++t/Module_Pluggable/10innerpack_onefile.t Module::Pluggable tests + t/Module_Pluggable/10innerpack_override.t Module::Pluggable tests ++t/Module_Pluggable/10innerpack_super.t Module::Pluggable tests + t/Module_Pluggable/10innerpack.t Module::Pluggable tests + t/Module_Pluggable/11usetwice.t Module::Pluggable tests + t/Module_Pluggable/12onlyarray.t Module::Pluggable tests + t/Module_Pluggable/12onlyregex.t Module::Pluggable tests ++t/Module_Pluggable/12onlyrequire.t Module::Pluggable tests + t/Module_Pluggable/12only.t Module::Pluggable tests + t/Module_Pluggable/13exceptarray.t Module::Pluggable tests + t/Module_Pluggable/13exceptregex.t Module::Pluggable tests +@@ -3628,8 +3631,15 @@ + t/Module_Pluggable/18skipped_package.t Module::Pluggable tests + t/Module_Pluggable/19can_ok_clobber.t Module::Pluggable tests + t/Module_Pluggable/20dodgy_files.t Module::Pluggable tests ++t/Module_Pluggable/21editor_junk.t Module::Pluggable tests + t/Module_Pluggable/acme/Acme/MyTest/Plugin/Foo.pm Module::Pluggable tests + t/Module_Pluggable/lib/Acme/MyTest/Plugin/Foo.pm Module::Pluggable tests ++t/Module_Pluggable/lib/Acme/Foo-Bar.pm Module::Pluggable tests ++t/Module_Pluggable/lib/EditorJunk/Plugin/Foo.pm Module::Pluggable tests ++t/Module_Pluggable/lib/EditorJunk/Plugin/Bar.pm.swo Module::Pluggable tests ++t/Module_Pluggable/lib/EditorJunk/Plugin/Bar.pm.swp Module::Pluggable tests ++t/Module_Pluggable/lib/EditorJunk/Plugin/Bar.pm~ Module::Pluggable tests ++t/Module_Pluggable/lib/EditorJunk/Plugin/Bar.pm Module::Pluggable tests + t/Module_Pluggable/lib/ExtTest/Plugin/Bar.plugin Module::Pluggable tests + t/Module_Pluggable/lib/ExtTest/Plugin/Foo.plugin Module::Pluggable tests + t/Module_Pluggable/lib/ExtTest/Plugin/Quux/Foo.plugin Module::Pluggable tests +@@ -3646,6 +3656,7 @@ + t/Module_Pluggable/lib/OddTest/Plugin/-Dodgy.pm Module::Pluggable tests + t/Module_Pluggable/lib/OddTest/Plugin/Foo.pm Module::Pluggable tests + t/Module_Pluggable/lib/TA/C/A/I.pm Module::Pluggable tests ++t/Module_Pluggable/lib/Zot/.Zork.pm Module::Pluggable tests + t/mro/basic_01_c3.t mro tests + t/mro/basic_01_dfs.t mro tests + t/mro/basic_02_c3.t mro tests +diff -urN perl-5.10.0.orig/t/Module_Pluggable/02alsoworks.t perl-5.10.0/t/Module_Pluggable/02alsoworks.t +--- perl-5.10.0.orig/t/Module_Pluggable/02alsoworks.t 2007-12-18 02:47:08.000000000 -0800 ++++ perl-5.10.0/t/Module_Pluggable/02alsoworks.t 2009-08-31 19:47:24.454770805 -0700 +@@ -2,7 +2,7 @@ + + use strict; + use FindBin; +-use lib "$FindBin::Bin/lib"; ++use lib (($FindBin::Bin."/lib")=~/^(.*)$/); + use Test::More tests => 5; + + my $foo; +diff -urN perl-5.10.0.orig/t/Module_Pluggable/02works.t perl-5.10.0/t/Module_Pluggable/02works.t +--- perl-5.10.0.orig/t/Module_Pluggable/02works.t 2007-12-18 02:47:08.000000000 -0800 ++++ perl-5.10.0/t/Module_Pluggable/02works.t 2009-08-31 19:47:24.455771358 -0700 +@@ -2,7 +2,7 @@ + + use strict; + use FindBin; +-use lib "$FindBin::Bin/lib"; ++use lib (($FindBin::Bin."/lib")=~/^(.*)$/); + use Test::More tests => 5; + + my $foo; +diff -urN perl-5.10.0.orig/t/Module_Pluggable/03diffname.t perl-5.10.0/t/Module_Pluggable/03diffname.t +--- perl-5.10.0.orig/t/Module_Pluggable/03diffname.t 2007-12-18 02:47:08.000000000 -0800 ++++ perl-5.10.0/t/Module_Pluggable/03diffname.t 2009-08-31 19:47:24.456771493 -0700 +@@ -2,7 +2,7 @@ + + use strict; + use FindBin; +-use lib "$FindBin::Bin/lib"; ++use lib (($FindBin::Bin."/lib")=~/^(.*)$/); + use Test::More tests => 3; + + my $foo; +diff -urN perl-5.10.0.orig/t/Module_Pluggable/04acmedir_single.t perl-5.10.0/t/Module_Pluggable/04acmedir_single.t +--- perl-5.10.0.orig/t/Module_Pluggable/04acmedir_single.t 2007-12-18 02:47:08.000000000 -0800 ++++ perl-5.10.0/t/Module_Pluggable/04acmedir_single.t 2009-08-31 19:47:24.456771493 -0700 +@@ -2,7 +2,7 @@ + + use strict; + use FindBin; +-use lib "$FindBin::Bin/lib"; ++use lib (($FindBin::Bin."/lib")=~/^(.*)$/); + use Test::More tests => 3; + + +diff -urN perl-5.10.0.orig/t/Module_Pluggable/04acmedir.t perl-5.10.0/t/Module_Pluggable/04acmedir.t +--- perl-5.10.0.orig/t/Module_Pluggable/04acmedir.t 2007-12-18 02:47:08.000000000 -0800 ++++ perl-5.10.0/t/Module_Pluggable/04acmedir.t 2009-08-31 19:47:24.457771627 -0700 +@@ -2,7 +2,7 @@ + + use strict; + use FindBin; +-use lib "$FindBin::Bin/lib"; ++use lib (($FindBin::Bin."/lib")=~/^(.*)$/); + use Test::More tests => 3; + + +diff -urN perl-5.10.0.orig/t/Module_Pluggable/04acmepath_single.t perl-5.10.0/t/Module_Pluggable/04acmepath_single.t +--- perl-5.10.0.orig/t/Module_Pluggable/04acmepath_single.t 2007-12-18 02:47:08.000000000 -0800 ++++ perl-5.10.0/t/Module_Pluggable/04acmepath_single.t 2009-08-31 19:47:24.458773508 -0700 +@@ -2,7 +2,7 @@ + + use strict; + use FindBin; +-use lib "$FindBin::Bin/lib"; ++use lib (($FindBin::Bin."/lib")=~/^(.*)$/); + use Test::More tests => 3; + + +diff -urN perl-5.10.0.orig/t/Module_Pluggable/04acmepath.t perl-5.10.0/t/Module_Pluggable/04acmepath.t +--- perl-5.10.0.orig/t/Module_Pluggable/04acmepath.t 2007-12-18 02:47:08.000000000 -0800 ++++ perl-5.10.0/t/Module_Pluggable/04acmepath.t 2009-08-31 19:47:24.459772105 -0700 +@@ -2,7 +2,7 @@ + + use strict; + use FindBin; +-use lib "$FindBin::Bin/lib"; ++use lib (($FindBin::Bin."/lib")=~/^(.*)$/); + use Test::More tests => 3; + + +diff -urN perl-5.10.0.orig/t/Module_Pluggable/05postpath.t perl-5.10.0/t/Module_Pluggable/05postpath.t +--- perl-5.10.0.orig/t/Module_Pluggable/05postpath.t 2007-12-18 02:47:08.000000000 -0800 ++++ perl-5.10.0/t/Module_Pluggable/05postpath.t 2009-08-31 19:47:24.460771332 -0700 +@@ -2,7 +2,7 @@ + + use strict; + use FindBin; +-use lib "$FindBin::Bin/lib"; ++use lib (($FindBin::Bin."/lib")=~/^(.*)$/); + use Test::More tests => 3; + + +diff -urN perl-5.10.0.orig/t/Module_Pluggable/06multipath.t perl-5.10.0/t/Module_Pluggable/06multipath.t +--- perl-5.10.0.orig/t/Module_Pluggable/06multipath.t 2007-12-18 02:47:08.000000000 -0800 ++++ perl-5.10.0/t/Module_Pluggable/06multipath.t 2009-08-31 19:47:24.461771676 -0700 +@@ -2,7 +2,7 @@ + + use strict; + use FindBin; +-use lib "$FindBin::Bin/lib"; ++use lib (($FindBin::Bin."/lib")=~/^(.*)$/); + use Test::More tests => 3; + + +diff -urN perl-5.10.0.orig/t/Module_Pluggable/07instantiate.t perl-5.10.0/t/Module_Pluggable/07instantiate.t +--- perl-5.10.0.orig/t/Module_Pluggable/07instantiate.t 2007-12-18 02:47:08.000000000 -0800 ++++ perl-5.10.0/t/Module_Pluggable/07instantiate.t 2009-08-31 19:47:24.462772090 -0700 +@@ -2,7 +2,7 @@ + + use strict; + use FindBin; +-use lib "$FindBin::Bin/lib"; ++use lib (($FindBin::Bin."/lib")=~/^(.*)$/); + use Test::More tests => 6; + + my $foo; +@@ -26,7 +26,7 @@ + use File::Spec::Functions qw(catdir); + use strict; + use FindBin; +-use lib "$FindBin::Bin/lib"; ++use lib (($FindBin::Bin."/lib")=~/^(.*)$/); + use Module::Pluggable (search_path => ["MyTest::Extend::Plugin"], sub_name => 'booga', instantiate => 'new'); + use Module::Pluggable (search_path => ["MyTest::Extend::Plugin"], sub_name => 'wooga', instantiate => 'nosomuchmethod'); + +diff -urN perl-5.10.0.orig/t/Module_Pluggable/08nothing.t perl-5.10.0/t/Module_Pluggable/08nothing.t +--- perl-5.10.0.orig/t/Module_Pluggable/08nothing.t 2007-12-18 02:47:08.000000000 -0800 ++++ perl-5.10.0/t/Module_Pluggable/08nothing.t 2009-08-31 19:47:24.463771316 -0700 +@@ -2,7 +2,7 @@ + + use strict; + use FindBin; +-use lib "$FindBin::Bin/lib"; ++use lib (($FindBin::Bin."/lib")=~/^(.*)$/); + use Test::More tests => 2; + + +diff -urN perl-5.10.0.orig/t/Module_Pluggable/09require.t perl-5.10.0/t/Module_Pluggable/09require.t +--- perl-5.10.0.orig/t/Module_Pluggable/09require.t 2007-12-18 02:47:08.000000000 -0800 ++++ perl-5.10.0/t/Module_Pluggable/09require.t 2009-08-31 19:47:24.464771800 -0700 +@@ -2,7 +2,7 @@ + + use strict; + use FindBin; +-use lib "$FindBin::Bin/lib"; ++use lib (($FindBin::Bin."/lib")=~/^(.*)$/); + use Test::More tests => 2; + + my $t = MyTest->new(); +diff -urN perl-5.10.0.orig/t/Module_Pluggable/10innerpack_inner.t perl-5.10.0/t/Module_Pluggable/10innerpack_inner.t +--- perl-5.10.0.orig/t/Module_Pluggable/10innerpack_inner.t 2007-12-18 02:47:08.000000000 -0800 ++++ perl-5.10.0/t/Module_Pluggable/10innerpack_inner.t 2009-08-31 19:47:24.465771515 -0700 +@@ -2,7 +2,7 @@ + + use strict; + use FindBin; +-use lib "$FindBin::Bin/lib"; ++use lib (($FindBin::Bin."/lib")=~/^(.*)$/); + use Test::More tests => 3; + + +diff -urN perl-5.10.0.orig/t/Module_Pluggable/10innerpack_noinner.t perl-5.10.0/t/Module_Pluggable/10innerpack_noinner.t +--- perl-5.10.0.orig/t/Module_Pluggable/10innerpack_noinner.t 2007-12-18 02:47:08.000000000 -0800 ++++ perl-5.10.0/t/Module_Pluggable/10innerpack_noinner.t 2009-08-31 19:47:24.479772629 -0700 +@@ -2,7 +2,7 @@ + + use strict; + use FindBin; +-use lib "$FindBin::Bin/lib"; ++use lib (($FindBin::Bin."/lib")=~/^(.*)$/); + use Test::More tests => 3; + + +diff -urN perl-5.10.0.orig/t/Module_Pluggable/10innerpack_onefile.t perl-5.10.0/t/Module_Pluggable/10innerpack_onefile.t +--- perl-5.10.0.orig/t/Module_Pluggable/10innerpack_onefile.t 1969-12-31 16:00:00.000000000 -0800 ++++ perl-5.10.0/t/Module_Pluggable/10innerpack_onefile.t 2009-08-31 19:47:24.480772134 -0700 +@@ -0,0 +1,27 @@ ++#!perl -wT ++ ++use strict; ++use Test::More tests => 2; ++use Data::Dumper; ++ ++my $mc = MyClass->new(); ++my $mc2 = MyClass2->new(); ++ ++ ++is_deeply([$mc->plugins], [qw(MyClass::Plugin::MyPlugin)], "Got inner plugin"); ++is_deeply([$mc2->plugins], [], "Didn't get plugin"); ++ ++package MyClass::Plugin::MyPlugin; ++sub pretty { print "I am pretty" }; ++ ++package MyClass; ++use Module::Pluggable inner => 1; ++ ++sub new { return bless {}, $_[0] } ++ ++package MyClass2; ++use Module::Pluggable search_path => "MyClass::Plugin", inner => 0; ++ ++sub new { return bless {}, $_[0] } ++1; ++ +diff -urN perl-5.10.0.orig/t/Module_Pluggable/10innerpack_override.t perl-5.10.0/t/Module_Pluggable/10innerpack_override.t +--- perl-5.10.0.orig/t/Module_Pluggable/10innerpack_override.t 2007-12-18 02:47:08.000000000 -0800 ++++ perl-5.10.0/t/Module_Pluggable/10innerpack_override.t 2009-08-31 19:47:24.481771501 -0700 +@@ -2,7 +2,7 @@ + + use strict; + use FindBin; +-use lib "$FindBin::Bin/lib"; ++use lib (($FindBin::Bin."/lib")=~/^(.*)$/); + use Test::More tests => 3; + + +diff -urN perl-5.10.0.orig/t/Module_Pluggable/10innerpack_super.t perl-5.10.0/t/Module_Pluggable/10innerpack_super.t +--- perl-5.10.0.orig/t/Module_Pluggable/10innerpack_super.t 1969-12-31 16:00:00.000000000 -0800 ++++ perl-5.10.0/t/Module_Pluggable/10innerpack_super.t 2009-08-31 19:47:24.482771565 -0700 +@@ -0,0 +1,29 @@ ++#!perl -wT ++ ++use Test::More tests => 3; ++use strict; ++use_ok('Devel::InnerPackage'); ++Bar->whee; ++is_deeply([Devel::InnerPackage::list_packages("Bar")],[], "Don't pick up ::SUPER pseudo stash"); ++is_deeply([Devel::InnerPackage::list_packages("Foo")],['Foo::Bar'], "Still pick up other inner package"); ++ ++package Foo; ++ ++sub whee { ++ 1; ++} ++ ++package Foo::Bar; ++ ++sub whee {} ++ ++package Bar; ++use base 'Foo'; ++ ++sub whee { ++ shift->SUPER::whee; ++ 2; ++} ++ ++ ++1; +diff -urN perl-5.10.0.orig/t/Module_Pluggable/10innerpack.t perl-5.10.0/t/Module_Pluggable/10innerpack.t +--- perl-5.10.0.orig/t/Module_Pluggable/10innerpack.t 2007-12-18 02:47:08.000000000 -0800 ++++ perl-5.10.0/t/Module_Pluggable/10innerpack.t 2009-08-31 19:47:24.483771909 -0700 +@@ -2,7 +2,7 @@ + + use strict; + use FindBin; +-use lib "$FindBin::Bin/lib"; ++use lib (($FindBin::Bin."/lib")=~/^(.*)$/); + use Test::More tests => 4; + + +diff -urN perl-5.10.0.orig/t/Module_Pluggable/11usetwice.t perl-5.10.0/t/Module_Pluggable/11usetwice.t +--- perl-5.10.0.orig/t/Module_Pluggable/11usetwice.t 2007-12-18 02:47:08.000000000 -0800 ++++ perl-5.10.0/t/Module_Pluggable/11usetwice.t 2009-08-31 19:47:24.484771624 -0700 +@@ -2,7 +2,7 @@ + + use strict; + use FindBin; +-use lib "$FindBin::Bin/lib"; ++use lib (($FindBin::Bin."/lib")=~/^(.*)$/); + use Test::More tests => 3; + + my $foo; +diff -urN perl-5.10.0.orig/t/Module_Pluggable/12onlyarray.t perl-5.10.0/t/Module_Pluggable/12onlyarray.t +--- perl-5.10.0.orig/t/Module_Pluggable/12onlyarray.t 2007-12-18 02:47:08.000000000 -0800 ++++ perl-5.10.0/t/Module_Pluggable/12onlyarray.t 2009-08-31 19:47:24.485772038 -0700 +@@ -2,7 +2,7 @@ + + use strict; + use FindBin; +-use lib "$FindBin::Bin/lib"; ++use lib (($FindBin::Bin."/lib")=~/^(.*)$/); + use Test::More tests => 10; + + { +diff -urN perl-5.10.0.orig/t/Module_Pluggable/12onlyregex.t perl-5.10.0/t/Module_Pluggable/12onlyregex.t +--- perl-5.10.0.orig/t/Module_Pluggable/12onlyregex.t 2007-12-18 02:47:08.000000000 -0800 ++++ perl-5.10.0/t/Module_Pluggable/12onlyregex.t 2009-08-31 19:47:24.485772038 -0700 +@@ -2,7 +2,7 @@ + + use strict; + use FindBin; +-use lib "$FindBin::Bin/lib"; ++use lib (($FindBin::Bin."/lib")=~/^(.*)$/); + use Test::More tests => 10; + + { +diff -urN perl-5.10.0.orig/t/Module_Pluggable/12onlyrequire.t perl-5.10.0/t/Module_Pluggable/12onlyrequire.t +--- perl-5.10.0.orig/t/Module_Pluggable/12onlyrequire.t 1969-12-31 16:00:00.000000000 -0800 ++++ perl-5.10.0/t/Module_Pluggable/12onlyrequire.t 2009-08-31 19:47:24.505021273 -0700 +@@ -0,0 +1,21 @@ ++#!perl -w ++use strict; ++use FindBin; ++use lib (($FindBin::Bin."/lib")=~/^(.*)$/); ++use Test::More tests => 2; ++ ++my @packages = eval { Zot->_dist_types }; ++is($@, '', "No warnings"); ++is(scalar(@packages), 0, "Correctly only got 1 package"); ++ ++ ++package Zot; ++use strict; ++use Module::Pluggable ( ++ sub_name => '_dist_types', ++ search_path => __PACKAGE__, ++ only => qr/Zot::\w+$/, ++ require => 1, ++ ); ++ ++1; +diff -urN perl-5.10.0.orig/t/Module_Pluggable/12only.t perl-5.10.0/t/Module_Pluggable/12only.t +--- perl-5.10.0.orig/t/Module_Pluggable/12only.t 2007-12-18 02:47:08.000000000 -0800 ++++ perl-5.10.0/t/Module_Pluggable/12only.t 2009-08-31 19:47:24.506022385 -0700 +@@ -2,7 +2,7 @@ + + use strict; + use FindBin; +-use lib "$FindBin::Bin/lib"; ++use lib (($FindBin::Bin."/lib")=~/^(.*)$/); + use Test::More tests => 10; + + { +diff -urN perl-5.10.0.orig/t/Module_Pluggable/13exceptarray.t perl-5.10.0/t/Module_Pluggable/13exceptarray.t +--- perl-5.10.0.orig/t/Module_Pluggable/13exceptarray.t 2007-12-18 02:47:08.000000000 -0800 ++++ perl-5.10.0/t/Module_Pluggable/13exceptarray.t 2009-08-31 19:47:24.507021263 -0700 +@@ -1,8 +1,8 @@ +-#!perl -w ++#!perl -wT + + use strict; + use FindBin; +-use lib "$FindBin::Bin/lib"; ++use lib (($FindBin::Bin."/lib")=~/^(.*)$/); + use Test::More tests => 10; + + { +diff -urN perl-5.10.0.orig/t/Module_Pluggable/13exceptregex.t perl-5.10.0/t/Module_Pluggable/13exceptregex.t +--- perl-5.10.0.orig/t/Module_Pluggable/13exceptregex.t 2007-12-18 02:47:08.000000000 -0800 ++++ perl-5.10.0/t/Module_Pluggable/13exceptregex.t 2009-08-31 19:47:24.510021945 -0700 +@@ -1,8 +1,8 @@ +-#!perl -w ++#!perl -wT + + use strict; + use FindBin; +-use lib "$FindBin::Bin/lib"; ++use lib (($FindBin::Bin."/lib")=~/^(.*)$/); + use Test::More tests => 10; + + { +diff -urN perl-5.10.0.orig/t/Module_Pluggable/13except.t perl-5.10.0/t/Module_Pluggable/13except.t +--- perl-5.10.0.orig/t/Module_Pluggable/13except.t 2007-12-18 02:47:08.000000000 -0800 ++++ perl-5.10.0/t/Module_Pluggable/13except.t 2009-08-31 19:47:24.511021381 -0700 +@@ -2,7 +2,7 @@ + + use strict; + use FindBin; +-use lib "$FindBin::Bin/lib"; ++use lib (($FindBin::Bin."/lib")=~/^(.*)$/); + use Test::More tests => 10; + + { +diff -urN perl-5.10.0.orig/t/Module_Pluggable/14package.t perl-5.10.0/t/Module_Pluggable/14package.t +--- perl-5.10.0.orig/t/Module_Pluggable/14package.t 2007-12-18 02:47:08.000000000 -0800 ++++ perl-5.10.0/t/Module_Pluggable/14package.t 2009-08-31 19:47:24.842414378 -0700 +@@ -2,7 +2,7 @@ + + use strict; + use FindBin; +-use lib "$FindBin::Bin/lib"; ++use lib (($FindBin::Bin."/lib")=~/^(.*)$/); + use Test::More tests => 5; + + my $foo; +diff -urN perl-5.10.0.orig/t/Module_Pluggable/15topicsafe.t perl-5.10.0/t/Module_Pluggable/15topicsafe.t +--- perl-5.10.0.orig/t/Module_Pluggable/15topicsafe.t 2007-12-18 02:47:08.000000000 -0800 ++++ perl-5.10.0/t/Module_Pluggable/15topicsafe.t 2009-08-31 19:47:24.842774343 -0700 +@@ -2,7 +2,7 @@ + + use strict; + use FindBin; +-use lib "$FindBin::Bin/lib"; ++use lib (($FindBin::Bin."/lib")=~/^(.*)$/); + use Test::More 'no_plan'; + + use Module::Pluggable search_path => 'Acme::MyTest'; +diff -urN perl-5.10.0.orig/t/Module_Pluggable/16different_extension.t perl-5.10.0/t/Module_Pluggable/16different_extension.t +--- perl-5.10.0.orig/t/Module_Pluggable/16different_extension.t 2007-12-18 02:47:08.000000000 -0800 ++++ perl-5.10.0/t/Module_Pluggable/16different_extension.t 2009-08-31 19:47:24.843800947 -0700 +@@ -2,7 +2,7 @@ + + use strict; + use FindBin; +-use lib "$FindBin::Bin/lib"; ++use lib (($FindBin::Bin."/lib")=~/^(.*)$/); + use Test::More tests => 5; + + my $foo; +diff -urN perl-5.10.0.orig/t/Module_Pluggable/17devel_inner_package.t perl-5.10.0/t/Module_Pluggable/17devel_inner_package.t +--- perl-5.10.0.orig/t/Module_Pluggable/17devel_inner_package.t 2007-12-18 02:47:08.000000000 -0800 ++++ perl-5.10.0/t/Module_Pluggable/17devel_inner_package.t 2009-08-31 19:47:24.843800947 -0700 +@@ -3,7 +3,7 @@ + + use Devel::InnerPackage qw(list_packages); + use FindBin; +-use lib "$FindBin::Bin/lib"; ++use lib (($FindBin::Bin."/lib")=~/^(.*)$/); + + my @packages; + +diff -urN perl-5.10.0.orig/t/Module_Pluggable/18skipped_package.t perl-5.10.0/t/Module_Pluggable/18skipped_package.t +--- perl-5.10.0.orig/t/Module_Pluggable/18skipped_package.t 2007-12-18 02:47:08.000000000 -0800 ++++ perl-5.10.0/t/Module_Pluggable/18skipped_package.t 2009-08-31 19:47:24.844780129 -0700 +@@ -2,7 +2,7 @@ + + use Test::More tests => 1; + use FindBin; +-use lib "$FindBin::Bin/lib"; ++use lib (($FindBin::Bin."/lib")=~/^(.*)$/); + + use Devel::InnerPackage qw(list_packages); + use No::Middle; +diff -urN perl-5.10.0.orig/t/Module_Pluggable/19can_ok_clobber.t perl-5.10.0/t/Module_Pluggable/19can_ok_clobber.t +--- perl-5.10.0.orig/t/Module_Pluggable/19can_ok_clobber.t 2007-12-18 02:47:08.000000000 -0800 ++++ perl-5.10.0/t/Module_Pluggable/19can_ok_clobber.t 2009-08-31 19:47:24.844780129 -0700 +@@ -3,7 +3,7 @@ + use warnings; + use Data::Dumper; + use FindBin; +-use lib "$FindBin::Bin/lib"; ++use lib (($FindBin::Bin."/lib")=~/^(.*)$/); + + use Test::More tests=>5; + +diff -urN perl-5.10.0.orig/t/Module_Pluggable/20dodgy_files.t perl-5.10.0/t/Module_Pluggable/20dodgy_files.t +--- perl-5.10.0.orig/t/Module_Pluggable/20dodgy_files.t 2007-12-18 02:47:08.000000000 -0800 ++++ perl-5.10.0/t/Module_Pluggable/20dodgy_files.t 2009-08-31 19:47:24.845769158 -0700 +@@ -1,7 +1,7 @@ + #!perl -w + + BEGIN { +- if ($^O eq 'VMS') { ++ if ($^O eq 'VMS' || $^O eq 'VOS') { + print "1..0 # Skip: can't handle misspelled plugin names\n"; + exit; + } +@@ -9,8 +9,18 @@ + + use strict; + use FindBin; +-use lib "$FindBin::Bin/lib"; +-use Test::More tests => 5; ++use Test::More; ++use lib (($FindBin::Bin."/lib")=~/^(.*)$/); ++use File::Spec::Functions qw(catfile); ++ ++ ++my ($dodgy_file) = (catfile($FindBin::Bin, "lib", "OddTest", "Plugin", "-Dodgy.pm")=~/^(.*)$/); ++unless (-f $dodgy_file) { ++ plan skip_all => "Can't handle misspelled plugin names\n"; ++} else { ++ plan tests => 5; ++} ++ + + my $foo; + ok($foo = OddTest->new()); +diff -urN perl-5.10.0.orig/t/Module_Pluggable/21editor_junk.t perl-5.10.0/t/Module_Pluggable/21editor_junk.t +--- perl-5.10.0.orig/t/Module_Pluggable/21editor_junk.t 1969-12-31 16:00:00.000000000 -0800 ++++ perl-5.10.0/t/Module_Pluggable/21editor_junk.t 2009-08-31 19:47:24.845769158 -0700 +@@ -0,0 +1,53 @@ ++#!perl -w ++ ++use Test::More; ++use FindBin; ++use lib (($FindBin::Bin."/lib")=~/^(.*)$/); ++use Module::Pluggable::Object; ++use File::Spec::Functions qw(catfile); ++ ++my ($dodgy_file) = (catfile($FindBin::Bin,"lib", "EditorJunk", "Plugin", "#Bar.pm#")=~/^(.*)$/); ++unless (-f $dodgy_file) { ++ plan skip_all => "Can't handle plugin names with octothorpes\n"; ++} else { ++ plan tests => 4; ++} ++ ++ ++ ++my $foo; ++ok($foo = EditorJunk->new()); ++ ++my @plugins; ++my @expected = qw(EditorJunk::Plugin::Bar EditorJunk::Plugin::Foo); ++ok(@plugins = sort $foo->plugins); ++ ++is_deeply(\@plugins, \@expected, "is deeply"); ++ ++ ++my $mpo = Module::Pluggable::Object->new( ++ package => 'EditorJunk', ++ filename => __FILE__, ++ include_editor_junk => 1, ++); ++ ++@expected = ('EditorJunk::Plugin::.#Bar', 'EditorJunk::Plugin::Bar', 'EditorJunk::Plugin::Foo'); ++@plugins = sort $mpo->plugins(); ++is_deeply(\@plugins, \@expected, "is deeply"); ++ ++ ++ ++package EditorJunk; ++ ++use strict; ++use Module::Pluggable; ++ ++ ++sub new { ++ my $class = shift; ++ return bless {}, $class; ++ ++} ++1; ++ ++ +diff -urN perl-5.10.0.orig/t/Module_Pluggable/lib/Acme/Foo-Bar.pm perl-5.10.0/t/Module_Pluggable/lib/Acme/Foo-Bar.pm +--- perl-5.10.0.orig/t/Module_Pluggable/lib/Acme/Foo-Bar.pm 1969-12-31 16:00:00.000000000 -0800 ++++ perl-5.10.0/t/Module_Pluggable/lib/Acme/Foo-Bar.pm 2009-08-31 19:47:24.845769158 -0700 +@@ -0,0 +1,6 @@ ++package Acme::FooBar; ++ ++our $quux = "hello"; ++ ++1; ++ +diff -urN perl-5.10.0.orig/t/Module_Pluggable/lib/EditorJunk/Plugin/Bar.pm perl-5.10.0/t/Module_Pluggable/lib/EditorJunk/Plugin/Bar.pm +--- perl-5.10.0.orig/t/Module_Pluggable/lib/EditorJunk/Plugin/Bar.pm 1969-12-31 16:00:00.000000000 -0800 ++++ perl-5.10.0/t/Module_Pluggable/lib/EditorJunk/Plugin/Bar.pm 2009-08-31 19:47:24.846769084 -0700 +@@ -0,0 +1,9 @@ ++package EditorJunk::Bar; ++ ++ ++use strict; ++ ++ ++1; ++ ++ +diff -urN perl-5.10.0.orig/t/Module_Pluggable/lib/EditorJunk/Plugin/Bar.pm~ perl-5.10.0/t/Module_Pluggable/lib/EditorJunk/Plugin/Bar.pm~ +--- perl-5.10.0.orig/t/Module_Pluggable/lib/EditorJunk/Plugin/Bar.pm~ 1969-12-31 16:00:00.000000000 -0800 ++++ perl-5.10.0/t/Module_Pluggable/lib/EditorJunk/Plugin/Bar.pm~ 2009-08-31 19:47:24.851770803 -0700 +@@ -0,0 +1,9 @@ ++package EditorJunk::Bar; ++ ++ ++use strict; ++ ++ ++1; ++ ++ +diff -urN perl-5.10.0.orig/t/Module_Pluggable/lib/EditorJunk/Plugin/Bar.pm.swo perl-5.10.0/t/Module_Pluggable/lib/EditorJunk/Plugin/Bar.pm.swo +--- perl-5.10.0.orig/t/Module_Pluggable/lib/EditorJunk/Plugin/Bar.pm.swo 1969-12-31 16:00:00.000000000 -0800 ++++ perl-5.10.0/t/Module_Pluggable/lib/EditorJunk/Plugin/Bar.pm.swo 2009-08-31 19:47:24.852771985 -0700 +@@ -0,0 +1,9 @@ ++package EditorJunk::Bar; ++ ++ ++use strict; ++ ++ ++1; ++ ++ +diff -urN perl-5.10.0.orig/t/Module_Pluggable/lib/EditorJunk/Plugin/Bar.pm.swp perl-5.10.0/t/Module_Pluggable/lib/EditorJunk/Plugin/Bar.pm.swp +--- perl-5.10.0.orig/t/Module_Pluggable/lib/EditorJunk/Plugin/Bar.pm.swp 1969-12-31 16:00:00.000000000 -0800 ++++ perl-5.10.0/t/Module_Pluggable/lib/EditorJunk/Plugin/Bar.pm.swp 2009-08-31 19:47:24.853771770 -0700 +@@ -0,0 +1,9 @@ ++package EditorJunk::Bar; ++ ++ ++use strict; ++ ++ ++1; ++ ++ +diff -urN perl-5.10.0.orig/t/Module_Pluggable/lib/EditorJunk/Plugin/Foo.pm perl-5.10.0/t/Module_Pluggable/lib/EditorJunk/Plugin/Foo.pm +--- perl-5.10.0.orig/t/Module_Pluggable/lib/EditorJunk/Plugin/Foo.pm 1969-12-31 16:00:00.000000000 -0800 ++++ perl-5.10.0/t/Module_Pluggable/lib/EditorJunk/Plugin/Foo.pm 2009-08-31 19:47:24.854771835 -0700 +@@ -0,0 +1,9 @@ ++package EditorJunk::Foo; ++ ++ ++use strict; ++ ++ ++1; ++ ++ diff --git a/perl-update-Test-Simple.patch b/perl-update-Test-Simple.patch index 6541cda..87b34fe 100644 --- a/perl-update-Test-Simple.patch +++ b/perl-update-Test-Simple.patch @@ -1,116 +1,13 @@ -Test-Simple-0.86 +Update to 0.92; patch by Iain Arnell (BZ#519417) -the following made the patch smaller: -mv Test-Simple-0.86/t/{Builder,Tester,} - -diff -urN perl-5.10.0.orig/MANIFEST perl-5.10.0/MANIFEST ---- perl-5.10.0.orig/MANIFEST 2007-12-18 11:47:07.000000000 +0100 -+++ perl-5.10.0/MANIFEST 2009-02-17 17:16:40.000000000 +0100 -@@ -2626,11 +2626,16 @@ - lib/Test/Simple/Changes Test::Simple changes - lib/Test/Simple.pm Basic utility for writing tests - lib/Test/Simple/README Test::Simple README -+lib/Test/Simple/TODO Test::Simple TODO - lib/Test/Simple/t/00test_harness_check.t Test::Simple test -+lib/Test/Simple/t/BEGIN_require_ok.t -+lib/Test/Simple/t/BEGIN_use_ok.t -+lib/Test/Simple/t/Builder.t Test::Builder tests -+lib/Test/Simple/t/More.t Test::More test, basic stuff - lib/Test/Simple/t/bad_plan.t Test::Builder plan() test - lib/Test/Simple/t/bail_out.t Test::Builder BAIL_OUT test - lib/Test/Simple/t/buffer.t Test::Builder buffering test --lib/Test/Simple/t/Builder.t Test::Builder tests -+lib/Test/Simple/t/c_flag.t - lib/Test/Simple/t/carp.t Test::Builder test - lib/Test/Simple/t/circular_data.t Test::Simple test - lib/Test/Simple/t/cmp_ok.t Test::More test -@@ -2638,19 +2643,22 @@ - lib/Test/Simple/t/curr_test.t Test::Builder->curr_test tests - lib/Test/Simple/t/details.t Test::Builder tests - lib/Test/Simple/t/diag.t Test::More diag() test -+lib/Test/Simple/t/died.t -+lib/Test/Simple/t/dont_overwrite_die_handler.t - lib/Test/Simple/t/eq_set.t Test::Simple test - lib/Test/Simple/t/exit.t Test::Simple test, exit codes --lib/Test/Simple/t/extra_one.t Test::Simple test -+lib/Test/Simple/t/explain.t - lib/Test/Simple/t/extra.t Test::Simple test -+lib/Test/Simple/t/extra_one.t Test::Simple test - lib/Test/Simple/t/fail-like.t Test::More test, like() failures - lib/Test/Simple/t/fail-more.t Test::More test, tests failing --lib/Test/Simple/t/fail_one.t Test::Simple test - lib/Test/Simple/t/fail.t Test::Simple test, test failures -+lib/Test/Simple/t/fail_one.t Test::Simple test - lib/Test/Simple/t/filehandles.t Test::Simple test, STDOUT can be played with - lib/Test/Simple/t/fork.t Test::More fork tests - lib/Test/Simple/t/harness_active.t Test::Simple test --lib/Test/Simple/t/has_plan2.t Test::More->plan tests - lib/Test/Simple/t/has_plan.t Test::Builder->plan tests -+lib/Test/Simple/t/has_plan2.t Test::More->plan tests - lib/Test/Simple/t/import.t Test::More test, importing functions - lib/Test/Simple/t/is_deeply_dne_bug.t Test::More test - lib/Test/Simple/t/is_deeply_fail.t Test::More test, is_deeply() -@@ -2660,27 +2668,30 @@ - lib/Test/Simple/t/lib/MyOverload.pm Test::More test module - lib/Test/Simple/t/maybe_regex.t Test::Builder->maybe_regex() tests - lib/Test/Simple/t/missing.t Test::Simple test, missing tests --lib/Test/Simple/t/More.t Test::More test, basic stuff -+lib/Test/Simple/t/new_ok.t - lib/Test/Simple/t/no_diag.t Test::Simple test - lib/Test/Simple/t/no_ending.t Test::Builder test, no_ending() - lib/Test/Simple/t/no_header.t Test::Builder test, no_header() - lib/Test/Simple/t/no_plan.t Test::Simple test, forgot the plan --lib/Test/Simple/TODO Test::Simple TODO -+lib/Test/Simple/t/no_tests.t -+lib/Test/Simple/t/note.t - lib/Test/Simple/t/ok_obj.t Test::Builder object tests - lib/Test/Simple/t/output.t Test::Builder test, output methods - lib/Test/Simple/t/overload.t Test::Simple test - lib/Test/Simple/t/overload_threads.t Test::Simple test -+lib/Test/Simple/t/plan.t Test::More test, plan() - lib/Test/Simple/t/plan_bad.t Test::Simple test - lib/Test/Simple/t/plan_is_noplan.t Test::Simple test, no_plan - lib/Test/Simple/t/plan_no_plan.t Test::More test, plan() w/no_plan - lib/Test/Simple/t/plan_shouldnt_import.t Test::Simple test - lib/Test/Simple/t/plan_skip_all.t Test::More test, plan() w/skip_all --lib/Test/Simple/t/plan.t Test::More test, plan() - lib/Test/Simple/t/require_ok.t Test::Simple test - lib/Test/Simple/t/reset.t Test::Simple test -+lib/Test/Simple/t/reset_outputs.t - lib/Test/Simple/t/simple.t Test::Simple test, basic stuff --lib/Test/Simple/t/skipall.t Test::More test, skip all tests - lib/Test/Simple/t/skip.t Test::More test, SKIP tests -+lib/Test/Simple/t/skipall.t Test::More test, skip all tests -+lib/Test/Simple/t/tbm_doesnt_set_exported_to.t - lib/Test/Simple/t/tbt_01basic.t Test::Builder::Tester test - lib/Test/Simple/t/tbt_02fhrestore.t Test::Builder::Tester test - lib/Test/Simple/t/tbt_03die.t Test::Builder::Tester test -@@ -2688,13 +2699,14 @@ - lib/Test/Simple/t/tbt_05faildiag.t Test::Builder::Tester test - lib/Test/Simple/t/tbt_06errormess.t Test::Builder::Tester test - lib/Test/Simple/t/tbt_07args.t Test::Builder::Tester test --lib/Test/Simple/t/threads.t Test::Builder thread-safe checks - lib/Test/Simple/t/thread_taint.t Test::Simple test -+lib/Test/Simple/t/threads.t Test::Builder thread-safe checks - lib/Test/Simple/t/todo.t Test::More test, TODO tests - lib/Test/Simple/t/try.t Test::More test - lib/Test/Simple/t/undef.t Test::More test, undefs don't cause warnings --lib/Test/Simple/t/useing.t Test::More test, compile test - lib/Test/Simple/t/use_ok.t Test::More test, use_ok() -+lib/Test/Simple/t/useing.t Test::More test, compile test -+lib/Test/Simple/t/utf8.t - lib/Test/t/05_about_verbose.t See if Test works - lib/Test/t/fail.t See if Test works - lib/Test/t/mix.t See if Test works diff -urN perl-5.10.0.orig/lib/Test/Builder/Module.pm perl-5.10.0/lib/Test/Builder/Module.pm --- perl-5.10.0.orig/lib/Test/Builder/Module.pm 2007-12-18 11:47:07.000000000 +0100 -+++ perl-5.10.0/lib/Test/Builder/Module.pm 2009-02-17 17:16:40.000000000 +0100 ++++ perl-5.10.0/lib/Test/Builder/Module.pm 2009-08-26 06:14:11.000000000 +0200 @@ -1,24 +1,24 @@ package Test::Builder::Module; -+# $Id$ -+ -+use strict; ++use strict; ++ use Test::Builder; require Exporter; @@ -120,7 +17,8 @@ diff -urN perl-5.10.0.orig/lib/Test/Builder/Module.pm perl-5.10.0/lib/Test/Build -$VERSION = '0.72'; - -use strict; -+our $VERSION = '0.86'; ++our $VERSION = '0.92'; ++$VERSION = eval $VERSION; ## no critic (BuiltinFunctions::ProhibitStringyEval) # 5.004's Exporter doesn't have export_to_level. my $_export_to_level = sub { @@ -208,14 +106,20 @@ diff -urN perl-5.10.0.orig/lib/Test/Builder/Module.pm perl-5.10.0/lib/Test/Build 1; diff -urN perl-5.10.0.orig/lib/Test/Builder/Tester/Color.pm perl-5.10.0/lib/Test/Builder/Tester/Color.pm --- perl-5.10.0.orig/lib/Test/Builder/Tester/Color.pm 2007-12-18 11:47:07.000000000 +0100 -+++ perl-5.10.0/lib/Test/Builder/Tester/Color.pm 2009-02-17 17:16:40.000000000 +0100 -@@ -1,4 +1,5 @@ ++++ perl-5.10.0/lib/Test/Builder/Tester/Color.pm 2009-08-26 06:14:11.000000000 +0200 +@@ -1,9 +1,11 @@ package Test::Builder::Tester::Color; -+# $Id$ use strict; ++our $VERSION = "1.18"; + + require Test::Builder::Tester; -@@ -25,8 +26,7 @@ ++ + =head1 NAME + + Test::Builder::Tester::Color - turn on colour in Test::Builder::Tester +@@ -25,8 +27,7 @@ =cut @@ -227,10 +131,9 @@ diff -urN perl-5.10.0.orig/lib/Test/Builder/Tester/Color.pm perl-5.10.0/lib/Test diff -urN perl-5.10.0.orig/lib/Test/Builder/Tester.pm perl-5.10.0/lib/Test/Builder/Tester.pm --- perl-5.10.0.orig/lib/Test/Builder/Tester.pm 2007-12-18 11:47:07.000000000 +0100 -+++ perl-5.10.0/lib/Test/Builder/Tester.pm 2009-02-17 17:16:40.000000000 +0100 -@@ -1,8 +1,8 @@ ++++ perl-5.10.0/lib/Test/Builder/Tester.pm 2009-08-26 06:14:11.000000000 +0200 +@@ -1,8 +1,7 @@ package Test::Builder::Tester; -+# $Id$ use strict; -use vars qw(@EXPORT $VERSION @ISA); @@ -239,7 +142,7 @@ diff -urN perl-5.10.0.orig/lib/Test/Builder/Tester.pm perl-5.10.0/lib/Test/Build use Test::Builder; use Symbol; -@@ -56,21 +56,20 @@ +@@ -56,21 +55,20 @@ ### use Exporter; @@ -269,7 +172,7 @@ diff -urN perl-5.10.0.orig/lib/Test/Builder/Tester.pm perl-5.10.0/lib/Test/Build } sub import { -@@ -83,14 +82,14 @@ +@@ -83,14 +81,14 @@ $t->plan(@plan); my @imports = (); @@ -287,7 +190,7 @@ diff -urN perl-5.10.0.orig/lib/Test/Builder/Tester.pm perl-5.10.0/lib/Test/Build } ### -@@ -124,8 +123,7 @@ +@@ -124,8 +122,7 @@ my $original_harness_env; # function that starts testing and redirects the filehandles for now @@ -297,7 +200,7 @@ diff -urN perl-5.10.0.orig/lib/Test/Builder/Tester.pm perl-5.10.0/lib/Test/Build # even if we're running under Test::Harness pretend we're not # for now. This needed so Test::Builder doesn't add extra spaces $original_harness_env = $ENV{HARNESS_ACTIVE} || 0; -@@ -146,7 +144,7 @@ +@@ -146,7 +143,7 @@ $err->reset(); # remeber that we're testing @@ -306,7 +209,7 @@ diff -urN perl-5.10.0.orig/lib/Test/Builder/Tester.pm perl-5.10.0/lib/Test/Build $testing_num = $t->current_test; $t->current_test(0); -@@ -188,20 +186,18 @@ +@@ -188,20 +185,18 @@ =cut @@ -331,7 +234,7 @@ diff -urN perl-5.10.0.orig/lib/Test/Builder/Tester.pm perl-5.10.0/lib/Test/Build } =item test_fail -@@ -230,14 +226,13 @@ +@@ -230,14 +225,13 @@ =cut @@ -349,7 +252,7 @@ diff -urN perl-5.10.0.orig/lib/Test/Builder/Tester.pm perl-5.10.0/lib/Test/Build # expect that on stderr $err->expect("# Failed test ($0 at line $line)"); -@@ -273,14 +268,13 @@ +@@ -273,14 +267,13 @@ =cut @@ -366,7 +269,7 @@ diff -urN perl-5.10.0.orig/lib/Test/Builder/Tester.pm perl-5.10.0/lib/Test/Build } =item test_test -@@ -322,24 +316,23 @@ +@@ -322,24 +315,23 @@ =cut @@ -405,7 +308,7 @@ diff -urN perl-5.10.0.orig/lib/Test/Builder/Tester.pm perl-5.10.0/lib/Test/Build # okay, reconnect the test suite back to the saved handles $t->output($original_output_handle); -@@ -354,20 +347,20 @@ +@@ -354,20 +346,20 @@ $ENV{HARNESS_ACTIVE} = $original_harness_env; # check the output we've stashed @@ -436,7 +339,7 @@ diff -urN perl-5.10.0.orig/lib/Test/Builder/Tester.pm perl-5.10.0/lib/Test/Build } } -@@ -383,10 +376,9 @@ +@@ -383,10 +375,9 @@ =cut @@ -450,7 +353,7 @@ diff -urN perl-5.10.0.orig/lib/Test/Builder/Tester.pm perl-5.10.0/lib/Test/Build } =back -@@ -432,10 +424,10 @@ +@@ -432,10 +423,10 @@ =cut my $color; @@ -465,7 +368,7 @@ diff -urN perl-5.10.0.orig/lib/Test/Builder/Tester.pm perl-5.10.0/lib/Test/Build } =back -@@ -490,21 +482,18 @@ +@@ -490,21 +481,18 @@ ## # add line(s) to be expected @@ -491,7 +394,7 @@ diff -urN perl-5.10.0.orig/lib/Test/Builder/Tester.pm perl-5.10.0/lib/Test/Build if( $check =~ /\A(.*)# (Failed .*test) \((.*?) at line (\d+)\)\Z(?!\n)/ ) { $check = "/\Q$1\E#\\s+\Q$2\E.*?\\n?.*?\Qat $3\E line \Q$4\E.*\\n?/"; -@@ -513,21 +502,19 @@ +@@ -513,21 +501,19 @@ return $check; } @@ -517,7 +420,7 @@ diff -urN perl-5.10.0.orig/lib/Test/Builder/Tester.pm perl-5.10.0/lib/Test/Build return 0 unless $got =~ s/^$check//; } -@@ -538,82 +525,71 @@ +@@ -538,82 +524,71 @@ # a complaint message about the inputs not matching (to be # used for debugging messages) @@ -642,7 +545,7 @@ diff -urN perl-5.10.0.orig/lib/Test/Builder/Tester.pm perl-5.10.0/lib/Test/Build my $self = shift; return $self->{type}; } -@@ -622,26 +598,24 @@ +@@ -622,26 +597,24 @@ # tie interface ### @@ -678,26 +581,31 @@ diff -urN perl-5.10.0.orig/lib/Test/Builder/Tester.pm perl-5.10.0/lib/Test/Build 1; diff -urN perl-5.10.0.orig/lib/Test/Builder.pm perl-5.10.0/lib/Test/Builder.pm --- perl-5.10.0.orig/lib/Test/Builder.pm 2007-12-18 11:47:07.000000000 +0100 -+++ perl-5.10.0/lib/Test/Builder.pm 2009-02-17 17:16:40.000000000 +0100 -@@ -1,25 +1,22 @@ ++++ perl-5.10.0/lib/Test/Builder.pm 2009-08-26 06:14:11.000000000 +0200 +@@ -1,25 +1,28 @@ package Test::Builder; -+# $Id$ -use 5.004; -- ++use 5.006; ++use strict; ++use warnings; + -# $^C was only introduced in 5.005-ish. We do this to prevent -# use of uninitialized value warnings in older perls. -$^C ||= 0; -- -+use 5.006; - use strict; ++our $VERSION = '0.92'; ++$VERSION = eval $VERSION; ## no critic (BuiltinFunctions::ProhibitStringyEval) ++ ++BEGIN { ++ if( $] < 5.008 ) { ++ require Test::Builder::IO::Scalar; ++ } ++} + +-use strict; -use vars qw($VERSION); -$VERSION = '0.72'; -$VERSION = eval $VERSION; # make the alpha version come out as a number -+use warnings; -+ -+our $VERSION = '0.86'; -+$VERSION = eval $VERSION; ## no critic (BuiltinFunctions::ProhibitStringyEval) # Make Test::Builder thread-safe for ithreads. BEGIN { @@ -713,7 +621,7 @@ diff -urN perl-5.10.0.orig/lib/Test/Builder.pm perl-5.10.0/lib/Test/Builder.pm # occassionally forget the contents of the variable when sharing it. # So we first copy the data, then share, then put our copy back. *share = sub (\[$@%]) { -@@ -27,31 +24,31 @@ +@@ -27,31 +30,31 @@ my $data; if( $type eq 'HASH' ) { @@ -754,7 +662,7 @@ diff -urN perl-5.10.0.orig/lib/Test/Builder.pm perl-5.10.0/lib/Test/Builder.pm } return $_[0]; -@@ -65,7 +62,6 @@ +@@ -65,7 +68,6 @@ } } @@ -762,7 +670,7 @@ diff -urN perl-5.10.0.orig/lib/Test/Builder.pm perl-5.10.0/lib/Test/Builder.pm =head1 NAME Test::Builder - Backend for building test libraries -@@ -73,28 +69,15 @@ +@@ -73,28 +75,15 @@ =head1 SYNOPSIS package My::Test::Module; @@ -795,7 +703,16 @@ diff -urN perl-5.10.0.orig/lib/Test/Builder.pm perl-5.10.0/lib/Test/Builder.pm } -@@ -128,13 +111,13 @@ +@@ -117,7 +106,7 @@ + test. + + Since you only run one test per program C always returns the same +-Test::Builder object. No matter how many times you call new(), you're ++Test::Builder object. No matter how many times you call C, you're + getting the same object. This is called a singleton. This is done so that + multiple modules share such global information as the test counter and + where test output is going. +@@ -128,13 +117,13 @@ =cut my $Test = Test::Builder->new; @@ -810,7 +727,7 @@ diff -urN perl-5.10.0.orig/lib/Test/Builder.pm perl-5.10.0/lib/Test/Builder.pm =item B my $Test = Test::Builder->create; -@@ -168,37 +151,40 @@ +@@ -168,37 +157,43 @@ =cut @@ -829,6 +746,8 @@ diff -urN perl-5.10.0.orig/lib/Test/Builder.pm perl-5.10.0/lib/Test/Builder.pm - $self->{Test_Died} = 0; $self->{Have_Plan} = 0; $self->{No_Plan} = 0; ++ $self->{Have_Output_Plan} = 0; ++ $self->{Original_Pid} = $$; - share($self->{Curr_Test}); @@ -855,6 +774,7 @@ diff -urN perl-5.10.0.orig/lib/Test/Builder.pm perl-5.10.0/lib/Test/Builder.pm + $self->{Todo} = undef; + $self->{Todo_Stack} = []; + $self->{Start_Todo} = 0; ++ $self->{Opened_Testhandles} = 0; - $self->_dup_stdhandles unless $^C; + $self->_dup_stdhandles; @@ -864,7 +784,7 @@ diff -urN perl-5.10.0.orig/lib/Test/Builder.pm perl-5.10.0/lib/Test/Builder.pm } =back -@@ -210,25 +196,6 @@ +@@ -210,25 +205,6 @@ =over 4 @@ -890,9 +810,21 @@ diff -urN perl-5.10.0.orig/lib/Test/Builder.pm perl-5.10.0/lib/Test/Builder.pm =item B $Test->plan('no_plan'); -@@ -243,36 +210,36 @@ +@@ -238,53 +214,62 @@ + A convenient way to set up your tests. Call this and Test::Builder + will print the appropriate headers and take the appropriate actions. + +-If you call plan(), don't call any of the other methods below. ++If you call C, don't call any of the other methods below. + =cut ++my %plan_cmds = ( ++ no_plan => \&no_plan, ++ skip_all => \&skip_all, ++ tests => \&_plan_tests, ++); ++ sub plan { - my($self, $cmd, $arg) = @_; + my( $self, $cmd, $arg ) = @_; @@ -904,29 +836,28 @@ diff -urN perl-5.10.0.orig/lib/Test/Builder.pm perl-5.10.0/lib/Test/Builder.pm - if( $self->{Have_Plan} ) { - $self->croak("You tried to plan twice"); - } -+ $self->croak("You tried to plan twice") -+ if $self->{Have_Plan}; ++ $self->croak("You tried to plan twice") if $self->{Have_Plan}; - if( $cmd eq 'no_plan' ) { -+ $self->carp("no_plan takes no arguments") if $arg; - $self->no_plan; - } - elsif( $cmd eq 'skip_all' ) { - return $self->skip_all($arg); - } - elsif( $cmd eq 'tests' ) { +- if( $cmd eq 'no_plan' ) { +- $self->no_plan; +- } +- elsif( $cmd eq 'skip_all' ) { +- return $self->skip_all($arg); +- } +- elsif( $cmd eq 'tests' ) { - if( $arg ) { -+ if($arg) { - local $Level = $Level + 1; - return $self->expected_tests($arg); - } - elsif( !defined $arg ) { - $self->croak("Got an undefined number of tests"); - } +- local $Level = $Level + 1; +- return $self->expected_tests($arg); +- } +- elsif( !defined $arg ) { +- $self->croak("Got an undefined number of tests"); +- } - elsif( !$arg ) { -+ else { - $self->croak("You said to run 0 tests"); - } +- $self->croak("You said to run 0 tests"); +- } ++ if( my $method = $plan_cmds{$cmd} ) { ++ local $Level = $Level + 1; ++ $self->$method($arg); } else { - my @args = grep { defined } ($cmd, $arg); @@ -934,7 +865,39 @@ diff -urN perl-5.10.0.orig/lib/Test/Builder.pm perl-5.10.0/lib/Test/Builder.pm $self->croak("plan() doesn't understand @args"); } -@@ -293,9 +260,9 @@ + return 1; + } + ++ ++sub _plan_tests { ++ my($self, $arg) = @_; ++ ++ if($arg) { ++ local $Level = $Level + 1; ++ return $self->expected_tests($arg); ++ } ++ elsif( !defined $arg ) { ++ $self->croak("Got an undefined number of tests"); ++ } ++ else { ++ $self->croak("You said to run 0 tests"); ++ } ++ ++ return; ++} ++ ++ + =item B + + my $max = $Test->expected_tests; + $Test->expected_tests($max); + +-Gets/sets the # of tests we expect this test to run and prints out ++Gets/sets the number of tests we expect this test to run and prints out + the appropriate headers. + + =cut +@@ -293,73 +278,204 @@ my $self = shift; my($max) = @_; @@ -946,7 +909,10 @@ diff -urN perl-5.10.0.orig/lib/Test/Builder.pm perl-5.10.0/lib/Test/Builder.pm $self->{Expected_Tests} = $max; $self->{Have_Plan} = 1; -@@ -305,7 +272,6 @@ + +- $self->_print("1..$max\n") unless $self->no_header; ++ $self->_output_plan($max) unless $self->no_header; + } return $self->{Expected_Tests}; } @@ -954,7 +920,17 @@ diff -urN perl-5.10.0.orig/lib/Test/Builder.pm perl-5.10.0/lib/Test/Builder.pm =item B $Test->no_plan; -@@ -319,6 +285,8 @@ + +-Declares that this test will run an indeterminate # of tests. ++Declares that this test will run an indeterminate number of tests. + + =cut + + sub no_plan { +- my $self = shift; ++ my($self, $arg) = @_; ++ ++ $self->carp("no_plan takes no arguments") if $arg; $self->{No_Plan} = 1; $self->{Have_Plan} = 1; @@ -962,8 +938,126 @@ diff -urN perl-5.10.0.orig/lib/Test/Builder.pm perl-5.10.0/lib/Test/Builder.pm + return 1; } ++ ++=begin private ++ ++=item B<_output_plan> ++ ++ $tb->_output_plan($max); ++ $tb->_output_plan($max, $directive); ++ $tb->_output_plan($max, $directive => $reason); ++ ++Handles displaying the test plan. ++ ++If a C<$directive> and/or C<$reason> are given they will be output with the ++plan. So here's what skipping all tests looks like: ++ ++ $tb->_output_plan(0, "SKIP", "Because I said so"); ++ ++It sets C<< $tb->{Have_Output_Plan} >> and will croak if the plan was already ++output. ++ ++=end private ++ ++=cut ++ ++sub _output_plan { ++ my($self, $max, $directive, $reason) = @_; ++ ++ $self->carp("The plan was already output") if $self->{Have_Output_Plan}; ++ ++ my $plan = "1..$max"; ++ $plan .= " # $directive" if defined $directive; ++ $plan .= " $reason" if defined $reason; ++ ++ $self->_print("$plan\n"); ++ ++ $self->{Have_Output_Plan} = 1; ++ ++ return; ++} ++ ++=item B ++ ++ $Test->done_testing(); ++ $Test->done_testing($num_tests); ++ ++Declares that you are done testing, no more tests will be run after this point. ++ ++If a plan has not yet been output, it will do so. ++ ++$num_tests is the number of tests you planned to run. If a numbered ++plan was already declared, and if this contradicts, a failing test ++will be run to reflect the planning mistake. If C was declared, ++this will override. ++ ++If C is called twice, the second call will issue a ++failing test. ++ ++If C<$num_tests> is omitted, the number of tests run will be used, like ++no_plan. ++ ++C is, in effect, used when you'd want to use C, but ++safer. You'd use it like so: ++ ++ $Test->ok($a == $b); ++ $Test->done_testing(); ++ ++Or to plan a variable number of tests: ++ ++ for my $test (@tests) { ++ $Test->ok($test); ++ } ++ $Test->done_testing(@tests); ++ ++=cut ++ ++sub done_testing { ++ my($self, $num_tests) = @_; ++ ++ # If done_testing() specified the number of tests, shut off no_plan. ++ if( defined $num_tests ) { ++ $self->{No_Plan} = 0; ++ } ++ else { ++ $num_tests = $self->current_test; ++ } ++ ++ if( $self->{Done_Testing} ) { ++ my($file, $line) = @{$self->{Done_Testing}}[1,2]; ++ $self->ok(0, "done_testing() was already called at $file line $line"); ++ return; ++ } ++ ++ $self->{Done_Testing} = [caller]; ++ ++ if( $self->expected_tests && $num_tests != $self->expected_tests ) { ++ $self->ok(0, "planned to run @{[ $self->expected_tests ]} ". ++ "but done_testing() expects $num_tests"); ++ } ++ else { ++ $self->{Expected_Tests} = $num_tests; ++ } ++ ++ $self->_output_plan($num_tests) unless $self->{Have_Output_Plan}; ++ ++ $self->{Have_Plan} = 1; ++ ++ return 1; ++} ++ ++ =item B -@@ -332,11 +300,10 @@ + + $plan = $Test->has_plan + +-Find out whether a plan has been defined. $plan is either C (no plan has been set), C (indeterminate # of tests) or an integer (the number of expected tests). ++Find out whether a plan has been defined. C<$plan> is either C (no plan ++has been set), C (indeterminate # of tests) or an integer (the number ++of expected tests). + + =cut + sub has_plan { my $self = shift; @@ -977,16 +1071,26 @@ diff -urN perl-5.10.0.orig/lib/Test/Builder.pm perl-5.10.0/lib/Test/Builder.pm =item B -@@ -348,7 +315,7 @@ + $Test->skip_all; + $Test->skip_all($reason); + +-Skips all the tests, using the given $reason. Exits immediately with 0. ++Skips all the tests, using the given C<$reason>. Exits immediately with 0. + =cut sub skip_all { - my($self, $reason) = @_; +- +- my $out = "1..0"; +- $out .= " # Skip $reason" if $reason; +- $out .= "\n"; + my( $self, $reason ) = @_; - my $out = "1..0"; - $out .= " # Skip $reason" if $reason; -@@ -360,6 +327,28 @@ + $self->{Skip_All} = 1; + +- $self->_print($out) unless $self->no_header; ++ $self->_output_plan(0, "SKIP", $reason) unless $self->no_header; exit(0); } @@ -1015,7 +1119,24 @@ diff -urN perl-5.10.0.orig/lib/Test/Builder.pm perl-5.10.0/lib/Test/Builder.pm =back =head2 Running tests -@@ -382,7 +371,7 @@ +@@ -368,7 +484,7 @@ + + They all return true if the test passed, false if the test failed. + +-$name is always optional. ++C<$name> is always optional. + + =over 4 + +@@ -376,42 +492,43 @@ + + $Test->ok($test, $name); + +-Your basic test. Pass if $test is true, fail if $test is false. Just +-like Test::Simple's ok(). ++Your basic test. Pass if C<$test> is true, fail if $test is false. Just ++like Test::Simple's C. + =cut sub ok { @@ -1024,7 +1145,11 @@ diff -urN perl-5.10.0.orig/lib/Test/Builder.pm perl-5.10.0/lib/Test/Builder.pm # $test might contain an object which we don't want to accidentally # store, so we turn it into a boolean. -@@ -394,24 +383,27 @@ + $test = $test ? 1 : 0; + +- $self->_plan_check; +- + lock $self->{Curr_Test}; $self->{Curr_Test}++; # In case $name is a string overloaded object, force it to stringify. @@ -1060,7 +1185,7 @@ diff -urN perl-5.10.0.orig/lib/Test/Builder.pm perl-5.10.0/lib/Test/Builder.pm } else { @$result{ 'ok', 'actual_ok' } = ( 1, $test ); -@@ -421,16 +413,16 @@ +@@ -421,16 +538,16 @@ $out .= " $self->{Curr_Test}" if $self->use_numbers; if( defined $name ) { @@ -1081,7 +1206,7 @@ diff -urN perl-5.10.0.orig/lib/Test/Builder.pm perl-5.10.0/lib/Test/Builder.pm $result->{reason} = $todo; $result->{type} = 'todo'; } -@@ -439,79 +431,81 @@ +@@ -439,309 +556,341 @@ $result->{type} = ''; } @@ -1196,7 +1321,20 @@ diff -urN perl-5.10.0.orig/lib/Test/Builder.pm perl-5.10.0/lib/Test/Builder.pm =item B -@@ -530,66 +524,85 @@ + $Test->is_eq($got, $expected, $name); + +-Like Test::More's is(). Checks if $got eq $expected. This is the ++Like Test::More's C. Checks if C<$got eq $expected>. This is the + string version. + + =item B + + $Test->is_num($got, $expected, $name); + +-Like Test::More's is(). Checks if $got == $expected. This is the ++Like Test::More's C. Checks if C<$got == $expected>. This is the + numeric version. + =cut sub is_eq { @@ -1277,15 +1415,15 @@ diff -urN perl-5.10.0.orig/lib/Test/Builder.pm perl-5.10.0/lib/Test/Builder.pm + + return; +} - -- return $self->diag(sprintf <_diag_fmt( $type, $_ ) for \$got, \$expect; -+ + +- return $self->diag(sprintf <diag(<<"DIAGNOSTIC"); + got: $got @@ -1309,7 +1447,20 @@ diff -urN perl-5.10.0.orig/lib/Test/Builder.pm perl-5.10.0/lib/Test/Builder.pm =item B -@@ -608,38 +621,37 @@ + $Test->isnt_eq($got, $dont_expect, $name); + +-Like Test::More's isnt(). Checks if $got ne $dont_expect. This is ++Like Test::More's C. Checks if C<$got ne $dont_expect>. This is + the string version. + + =item B + + $Test->isnt_num($got, $dont_expect, $name); + +-Like Test::More's isnt(). Checks if $got ne $dont_expect. This is ++Like Test::More's C. Checks if C<$got ne $dont_expect>. This is + the numeric version. + =cut sub isnt_eq { @@ -1356,7 +1507,24 @@ diff -urN perl-5.10.0.orig/lib/Test/Builder.pm perl-5.10.0/lib/Test/Builder.pm =item B $Test->like($this, qr/$regex/, $name); -@@ -660,20 +672,19 @@ + $Test->like($this, '/$regex/', $name); + +-Like Test::More's like(). Checks if $this matches the given $regex. ++Like Test::More's C. Checks if $this matches the given C<$regex>. + +-You'll want to avoid qr// if you want your tests to work before 5.005. ++You'll want to avoid C if you want your tests to work before 5.005. + + =item B + + $Test->unlike($this, qr/$regex/, $name); + $Test->unlike($this, '/$regex/', $name); + +-Like Test::More's unlike(). Checks if $this B the +-given $regex. ++Like Test::More's C. Checks if $this B the ++given C<$regex>. + =cut sub like { @@ -1381,7 +1549,11 @@ diff -urN perl-5.10.0.orig/lib/Test/Builder.pm perl-5.10.0/lib/Test/Builder.pm =item B $Test->cmp_ok($this, $type, $that, $name); -@@ -684,64 +695,77 @@ + +-Works just like Test::More's cmp_ok(). ++Works just like Test::More's C. + + $Test->cmp_ok($big_num, '!=', $other_big_num); =cut @@ -1489,7 +1661,7 @@ diff -urN perl-5.10.0.orig/lib/Test/Builder.pm perl-5.10.0/lib/Test/Builder.pm my $code = ''; $code .= "#line $line $file\n" if defined $file and defined $line; -@@ -771,7 +795,7 @@ +@@ -771,7 +920,7 @@ =cut sub BAIL_OUT { @@ -1498,7 +1670,7 @@ diff -urN perl-5.10.0.orig/lib/Test/Builder.pm perl-5.10.0/lib/Test/Builder.pm $self->{Bailed_Out} = 1; $self->_print("Bail out! $reason"); -@@ -785,7 +809,6 @@ +@@ -785,52 +934,50 @@ *BAILOUT = \&BAIL_OUT; @@ -1506,7 +1678,11 @@ diff -urN perl-5.10.0.orig/lib/Test/Builder.pm perl-5.10.0/lib/Test/Builder.pm =item B $Test->skip; -@@ -796,35 +819,36 @@ + $Test->skip($why); + +-Skips the current test, reporting $why. ++Skips the current test, reporting C<$why>. + =cut sub skip { @@ -1514,10 +1690,10 @@ diff -urN perl-5.10.0.orig/lib/Test/Builder.pm perl-5.10.0/lib/Test/Builder.pm + my( $self, $why ) = @_; $why ||= ''; - $self->_unoverload_str(\$why); +- +- $self->_plan_check; + $self->_unoverload_str( \$why ); - $self->_plan_check; - - lock($self->{Curr_Test}); + lock( $self->{Curr_Test} ); $self->{Curr_Test}++; @@ -1558,7 +1734,14 @@ diff -urN perl-5.10.0.orig/lib/Test/Builder.pm perl-5.10.0/lib/Test/Builder.pm =item B $Test->todo_skip; -@@ -838,32 +862,33 @@ + $Test->todo_skip($why); + +-Like skip(), only it will declare the test as failing and TODO. Similar ++Like C, only it will declare the test as failing and TODO. Similar + to + + print "not ok $tnum # TODO $why\n"; +@@ -838,32 +985,31 @@ =cut sub todo_skip { @@ -1566,8 +1749,8 @@ diff -urN perl-5.10.0.orig/lib/Test/Builder.pm perl-5.10.0/lib/Test/Builder.pm + my( $self, $why ) = @_; $why ||= ''; - $self->_plan_check; - +- $self->_plan_check; +- - lock($self->{Curr_Test}); + lock( $self->{Curr_Test} ); $self->{Curr_Test}++; @@ -1604,16 +1787,37 @@ diff -urN perl-5.10.0.orig/lib/Test/Builder.pm perl-5.10.0/lib/Test/Builder.pm =begin _unimplemented =item B -@@ -900,7 +925,7 @@ +@@ -871,10 +1017,10 @@ + $Test->skip_rest; + $Test->skip_rest($reason); + +-Like skip(), only it skips all the rest of the tests you plan to run ++Like C, only it skips all the rest of the tests you plan to run + and terminates the test. + +-If you're running under no_plan, it skips once and terminates the ++If you're running under C, it skips once and terminates the + test. + + =end _unimplemented +@@ -896,13 +1042,13 @@ + Convenience method for building testing functions that take regular + expressions as arguments, but need to work before perl 5.005. + +-Takes a quoted regular expression produced by qr//, or a string ++Takes a quoted regular expression produced by C, or a string representing a regular expression. Returns a Perl value which may be used instead of the corresponding -regular expression, or undef if it's argument is not recognised. -+regular expression, or undef if its argument is not recognised. ++regular expression, or C if its argument is not recognised. - For example, a version of like(), sans the useful diagnostic messages, +-For example, a version of like(), sans the useful diagnostic messages, ++For example, a version of C, sans the useful diagnostic messages, could be written as: -@@ -915,48 +940,60 @@ + + sub laconic_like { +@@ -915,48 +1061,60 @@ =cut @@ -1687,7 +1891,7 @@ diff -urN perl-5.10.0.orig/lib/Test/Builder.pm perl-5.10.0/lib/Test/Builder.pm # Don't ask me, man, I just work here. $test = eval " $code" . q{$test = $this =~ /$usable_regex/ ? 1 : 0}; -@@ -967,10 +1004,12 @@ +@@ -967,10 +1125,12 @@ $ok = $self->ok( $test, $name ); } @@ -1702,7 +1906,7 @@ diff -urN perl-5.10.0.orig/lib/Test/Builder.pm perl-5.10.0/lib/Test/Builder.pm %s %13s '%s' DIAGNOSTIC -@@ -980,7 +1019,6 @@ +@@ -980,7 +1140,6 @@ return $ok; } @@ -1710,19 +1914,21 @@ diff -urN perl-5.10.0.orig/lib/Test/Builder.pm perl-5.10.0/lib/Test/Builder.pm # I'm not ready to publish this. It doesn't deal with array return # values from the code or context. -@@ -991,7 +1029,10 @@ +@@ -991,23 +1150,33 @@ my $return_from_code = $Test->try(sub { code }); my($return_from_code, $error) = $Test->try(sub { code }); -Works like eval BLOCK except it ensures it has no effect on the rest of the test (ie. $@ is not set) nor is effected by outside interference (ie. $SIG{__DIE__}) and works around some quirks in older Perls. +Works like eval BLOCK except it ensures it has no effect on the rest -+of the test (ie. $@ is not set) nor is effected by outside -+interference (ie. $SIG{__DIE__}) and works around some quirks in older ++of the test (ie. C<$@> is not set) nor is effected by outside ++interference (ie. C<$SIG{__DIE__}>) and works around some quirks in older +Perls. - $error is what would normally be in $@. +-$error is what would normally be in $@. ++C<$error> is what would normally be in C<$@>. + + It is suggested you use this in place of eval BLOCK. -@@ -1000,14 +1041,21 @@ =cut sub _try { @@ -1752,7 +1958,13 @@ diff -urN perl-5.10.0.orig/lib/Test/Builder.pm perl-5.10.0/lib/Test/Builder.pm } =end private -@@ -1022,19 +1070,18 @@ +@@ -1017,24 +1186,23 @@ + + my $is_fh = $Test->is_fh($thing); + +-Determines if the given $thing can be used as a filehandle. ++Determines if the given C<$thing> can be used as a filehandle. + =cut sub is_fh { @@ -1776,7 +1988,16 @@ diff -urN perl-5.10.0.orig/lib/Test/Builder.pm perl-5.10.0/lib/Test/Builder.pm =back -@@ -1067,7 +1114,7 @@ +@@ -1047,7 +1215,7 @@ + + $Test->level($how_high); + +-How far up the call stack should $Test look when reporting where the ++How far up the call stack should C<$Test> look when reporting where the + test failed. + + Defaults to 1. +@@ -1067,7 +1235,7 @@ =cut sub level { @@ -1785,7 +2006,7 @@ diff -urN perl-5.10.0.orig/lib/Test/Builder.pm perl-5.10.0/lib/Test/Builder.pm if( defined $level ) { $Level = $level; -@@ -1075,7 +1122,6 @@ +@@ -1075,7 +1243,6 @@ return $Level; } @@ -1793,7 +2014,7 @@ diff -urN perl-5.10.0.orig/lib/Test/Builder.pm perl-5.10.0/lib/Test/Builder.pm =item B $Test->use_numbers($on_or_off); -@@ -1100,7 +1146,7 @@ +@@ -1100,7 +1267,7 @@ =cut sub use_numbers { @@ -1802,7 +2023,7 @@ diff -urN perl-5.10.0.orig/lib/Test/Builder.pm perl-5.10.0/lib/Test/Builder.pm if( defined $use_nums ) { $self->{Use_Nums} = $use_nums; -@@ -1108,7 +1154,6 @@ +@@ -1108,13 +1275,12 @@ return $self->{Use_Nums}; } @@ -1810,7 +2031,14 @@ diff -urN perl-5.10.0.orig/lib/Test/Builder.pm perl-5.10.0/lib/Test/Builder.pm =item B $Test->no_diag($no_diag); -@@ -1137,7 +1182,7 @@ + + If set true no diagnostics will be printed. This includes calls to +-diag(). ++C. + + =item B + +@@ -1137,7 +1303,7 @@ my $method = lc $attribute; my $code = sub { @@ -1819,7 +2047,7 @@ diff -urN perl-5.10.0.orig/lib/Test/Builder.pm perl-5.10.0/lib/Test/Builder.pm if( defined $no ) { $self->{$attribute} = $no; -@@ -1145,11 +1190,10 @@ +@@ -1145,11 +1311,10 @@ return $self->{$attribute}; }; @@ -1833,7 +2061,31 @@ diff -urN perl-5.10.0.orig/lib/Test/Builder.pm perl-5.10.0/lib/Test/Builder.pm =back =head2 Output -@@ -1188,7 +1232,35 @@ +@@ -1165,11 +1330,11 @@ + + $Test->diag(@msgs); + +-Prints out the given @msgs. Like C, arguments are simply ++Prints out the given C<@msgs>. Like C, arguments are simply + appended together. + +-Normally, it uses the failure_output() handle, but if this is for a +-TODO test, the todo_output() handle is used. ++Normally, it uses the C handle, but if this is for a ++TODO test, the C handle is used. + + Output will be indented and marked with a # so as not to interfere + with test output. A newline will be put on the end if there isn't one +@@ -1177,7 +1342,7 @@ + + We encourage using this rather than calling print directly. + +-Returns false. Why? Because diag() is often used in conjunction with ++Returns false. Why? Because C is often used in conjunction with + a failing test (C) it "passes through" the failure. + + return ok(...) || diag(...); +@@ -1188,7 +1353,35 @@ =cut sub diag { @@ -1847,7 +2099,7 @@ diff -urN perl-5.10.0.orig/lib/Test/Builder.pm perl-5.10.0/lib/Test/Builder.pm + + $Test->note(@msgs); + -+Like diag(), but it prints to the C handle so it will not ++Like C, but it prints to the C handle so it will not +normally be seen by the user except in verbose mode. + +=cut @@ -1870,7 +2122,7 @@ diff -urN perl-5.10.0.orig/lib/Test/Builder.pm perl-5.10.0/lib/Test/Builder.pm return if $self->no_diag; return unless @msgs; -@@ -1200,18 +1272,47 @@ +@@ -1200,32 +1393,66 @@ # Convert undef to 'undef' so its readable. my $msg = join '', map { defined($_) ? $_ : 'undef' } @msgs; @@ -1924,7 +2176,14 @@ diff -urN perl-5.10.0.orig/lib/Test/Builder.pm perl-5.10.0/lib/Test/Builder.pm =begin _private =item B<_print> -@@ -1225,7 +1326,12 @@ + + $Test->_print(@msgs); + +-Prints to the output() filehandle. ++Prints to the C filehandle. + + =end _private + =cut sub _print { @@ -1938,7 +2197,7 @@ diff -urN perl-5.10.0.orig/lib/Test/Builder.pm perl-5.10.0/lib/Test/Builder.pm # Prevent printing headers when only compiling. Mostly for when # tests are deparsed with B::Deparse -@@ -1233,39 +1339,18 @@ +@@ -1233,70 +1460,53 @@ my $msg = join '', @msgs; @@ -1981,8 +2240,49 @@ diff -urN perl-5.10.0.orig/lib/Test/Builder.pm perl-5.10.0/lib/Test/Builder.pm - =item B - $Test->output($fh); -@@ -1296,7 +1381,7 @@ +- $Test->output($fh); +- $Test->output($file); ++=item B + +-Where normal "ok/not ok" test output should go. ++=item B + +-Defaults to STDOUT. ++ my $filehandle = $Test->output; ++ $Test->output($filehandle); ++ $Test->output($filename); ++ $Test->output(\$scalar); ++ ++These methods control where Test::Builder will print its output. ++They take either an open C<$filehandle>, a C<$filename> to open and write to ++or a C<$scalar> reference to append to. It will always return a C<$filehandle>. + +-=item B ++B is where normal "ok/not ok" test output goes. + +- $Test->failure_output($fh); +- $Test->failure_output($file); ++Defaults to STDOUT. + +-Where diagnostic output on test failures and diag() should go. ++B is where diagnostic output on test failures and ++C goes. It is normally not read by Test::Harness and instead is ++displayed to the user. + + Defaults to STDERR. + +-=item B +- +- $Test->todo_output($fh); +- $Test->todo_output($file); +- +-Where diagnostics about todo test failures and diag() should go. ++C is used instead of C for the ++diagnostics of a failing TODO test. These will not be seen by the ++user. + + Defaults to STDOUT. + =cut sub output { @@ -1991,7 +2291,7 @@ diff -urN perl-5.10.0.orig/lib/Test/Builder.pm perl-5.10.0/lib/Test/Builder.pm if( defined $fh ) { $self->{Out_FH} = $self->_new_fh($fh); -@@ -1305,7 +1390,7 @@ +@@ -1305,7 +1515,7 @@ } sub failure_output { @@ -2000,7 +2300,7 @@ diff -urN perl-5.10.0.orig/lib/Test/Builder.pm perl-5.10.0/lib/Test/Builder.pm if( defined $fh ) { $self->{Fail_FH} = $self->_new_fh($fh); -@@ -1314,7 +1399,7 @@ +@@ -1314,7 +1524,7 @@ } sub todo_output { @@ -2009,7 +2309,7 @@ diff -urN perl-5.10.0.orig/lib/Test/Builder.pm perl-5.10.0/lib/Test/Builder.pm if( defined $fh ) { $self->{Todo_FH} = $self->_new_fh($fh); -@@ -1322,7 +1407,6 @@ +@@ -1322,7 +1532,6 @@ return $self->{Todo_FH}; } @@ -2017,9 +2317,22 @@ diff -urN perl-5.10.0.orig/lib/Test/Builder.pm perl-5.10.0/lib/Test/Builder.pm sub _new_fh { my $self = shift; my($file_or_fh) = shift; -@@ -1332,23 +1416,24 @@ +@@ -1331,24 +1540,37 @@ + if( $self->is_fh($file_or_fh) ) { $fh = $file_or_fh; } ++ elsif( ref $file_or_fh eq 'SCALAR' ) { ++ # Scalar refs as filehandles was added in 5.8. ++ if( $] >= 5.008 ) { ++ open $fh, ">>", $file_or_fh ++ or $self->croak("Can't open scalar ref $file_or_fh: $!"); ++ } ++ # Emulate scalar ref filehandles with a tie. ++ else { ++ $fh = Test::Builder::IO::Scalar->new($file_or_fh) ++ or $self->croak("Can't tie scalar ref $file_or_fh"); ++ } ++ } else { - $fh = do { local *FH }; - open $fh, ">$file_or_fh" or @@ -2047,7 +2360,7 @@ diff -urN perl-5.10.0.orig/lib/Test/Builder.pm perl-5.10.0/lib/Test/Builder.pm sub _dup_stdhandles { my $self = shift; -@@ -1357,27 +1442,68 @@ +@@ -1357,41 +1579,80 @@ # Set everything to unbuffered else plain prints to STDOUT will # come out in the wrong order from our own prints. @@ -2055,39 +2368,39 @@ diff -urN perl-5.10.0.orig/lib/Test/Builder.pm perl-5.10.0/lib/Test/Builder.pm - _autoflush(\*STDOUT); - _autoflush(\*TESTERR); - _autoflush(\*STDERR); -- -- $self->output(\*TESTOUT); -- $self->failure_output(\*TESTERR); -- $self->todo_output(\*TESTOUT); --} + _autoflush($Testout); + _autoflush( \*STDOUT ); + _autoflush($Testerr); + _autoflush( \*STDERR ); +- $self->output(\*TESTOUT); +- $self->failure_output(\*TESTERR); +- $self->todo_output(\*TESTOUT); +-} + $self->reset_outputs; -+ + + return; +} - my $Opened_Testhandles = 0; -+ +-my $Opened_Testhandles = 0; sub _open_testhandles { +- return if $Opened_Testhandles; + my $self = shift; + - return if $Opened_Testhandles; ++ return if $self->{Opened_Testhandles}; + # We dup STDOUT and STDERR so people can change them in their # test suites while still getting normal test output. - open(TESTOUT, ">&STDOUT") or die "Can't dup STDOUT: $!"; - open(TESTERR, ">&STDERR") or die "Can't dup STDERR: $!"; +- $Opened_Testhandles = 1; + open( $Testout, ">&STDOUT" ) or die "Can't dup STDOUT: $!"; + open( $Testerr, ">&STDERR" ) or die "Can't dup STDERR: $!"; + + # $self->_copy_io_layers( \*STDOUT, $Testout ); + # $self->_copy_io_layers( \*STDERR, $Testerr ); + - $Opened_Testhandles = 1; ++ $self->{Opened_Testhandles} = 1; + + return; +} @@ -2127,7 +2440,23 @@ diff -urN perl-5.10.0.orig/lib/Test/Builder.pm perl-5.10.0/lib/Test/Builder.pm =item carp -@@ -1399,18 +1525,18 @@ + $tb->carp(@message); + + Warns with C<@message> but the message will appear to come from the +-point where the original test function was called (C<$tb->caller>). ++point where the original test function was called (C<< $tb->caller >>). + + =item croak + + $tb->croak(@message); + + Dies with C<@message> but the message will appear to come from the +-point where the original test function was called (C<$tb->caller>). ++point where the original test function was called (C<< $tb->caller >>). + + =cut + +@@ -1399,28 +1660,20 @@ my $self = shift; local $Level = $Level + 1; @@ -2149,17 +2478,18 @@ diff -urN perl-5.10.0.orig/lib/Test/Builder.pm perl-5.10.0/lib/Test/Builder.pm + return die $self->_message_at_caller(@_); } - sub _plan_check { -@@ -1420,6 +1546,8 @@ - local $Level = $Level + 2; - $self->croak("You tried to run a test without a plan"); - } -+ -+ return; - } +-sub _plan_check { +- my $self = shift; +- +- unless( $self->{Have_Plan} ) { +- local $Level = $Level + 2; +- $self->croak("You tried to run a test without a plan"); +- } +-} =back -@@ -1444,13 +1572,12 @@ + +@@ -1444,28 +1697,26 @@ =cut sub current_test { @@ -2172,12 +2502,10 @@ diff -urN perl-5.10.0.orig/lib/Test/Builder.pm perl-5.10.0/lib/Test/Builder.pm - unless( $self->{Have_Plan} ) { - $self->croak("Can't change the current test number without a plan!"); - } -+ $self->croak("Can't change the current test number without a plan!") -+ unless $self->{Have_Plan}; - +- $self->{Curr_Test} = $num; -@@ -1458,14 +1585,16 @@ + # If the test counter is being pushed forward fill in the details. my $test_results = $self->{Test_Results}; if( $num > @$test_results ) { my $start = @$test_results ? @$test_results : 0; @@ -2202,7 +2530,7 @@ diff -urN perl-5.10.0.orig/lib/Test/Builder.pm perl-5.10.0/lib/Test/Builder.pm } } # If backward, wipe history. Its their funeral. -@@ -1476,7 +1605,6 @@ +@@ -1476,7 +1727,6 @@ return $self->{Curr_Test}; } @@ -2210,16 +2538,46 @@ diff -urN perl-5.10.0.orig/lib/Test/Builder.pm perl-5.10.0/lib/Test/Builder.pm =item B my @tests = $Test->summary; -@@ -1527,7 +1655,7 @@ +@@ -1498,7 +1748,7 @@ + + my @tests = $Test->details; + +-Like summary(), but with a lot more detail. ++Like C, but with a lot more detail. + + $tests[$test_num - 1] = + { 'ok' => is the test considered a pass? +@@ -1512,7 +1762,7 @@ + + 'actual_ok' is a reflection of whether or not the test literally + printed 'ok' or 'not ok'. This is for examining the result of 'todo' +-tests. ++tests. + + 'name' is the name of the test. + +@@ -1525,16 +1775,16 @@ + unknown see below + Sometimes the Test::Builder test counter is incremented without it - printing any test output, for example, when current_test() is changed. +-printing any test output, for example, when current_test() is changed. ++printing any test output, for example, when C is changed. In these cases, Test::Builder doesn't know the result of the test, so -it's type is 'unkown'. These details for these tests are filled in. +-They are considered ok, but the name and actual_ok is left undef. +its type is 'unknown'. These details for these tests are filled in. - They are considered ok, but the name and actual_ok is left undef. ++They are considered ok, but the name and actual_ok is left C. For example "not ok 23 - hole count # TODO insufficient donuts" would -@@ -1553,14 +1681,18 @@ + result in this structure: + + $tests[22] = # 23 - 1, since arrays start from 0. +- { ok => 1, # logically, the test passed since it's todo ++ { ok => 1, # logically, the test passed since its todo + actual_ok => 0, # in absolute terms, it failed + name => 'hole count', + type => 'todo', +@@ -1553,30 +1803,154 @@ my $todo_reason = $Test->todo; my $todo_reason = $Test->todo($pack); @@ -2232,31 +2590,33 @@ diff -urN perl-5.10.0.orig/lib/Test/Builder.pm perl-5.10.0/lib/Test/Builder.pm -uses the exported_to() package to find it. If that's not set, it's -pretty good at guessing the right package to look at based on $Level. +If the current tests are considered "TODO" it will return the reason, -+if any. This reason can come from a $TODO variable or the last call -+to C<>. ++if any. This reason can come from a C<$TODO> variable or the last call ++to C. + +Since a TODO test does not need a reason, this function can return an -+empty string even when inside a TODO block. Use C<<$Test->in_todo>> ++empty string even when inside a TODO block. Use C<< $Test->in_todo >> +to determine if you are currently inside a TODO block. + -+todo() is about finding the right package to look for $TODO in. It's ++C is about finding the right package to look for C<$TODO> in. It's +pretty good at guessing the right package to look at. It first looks for +the caller based on C<$Level + 1>, since C is usually called inside +a test function. As a last resort it will use C. Sometimes there is some confusion about where todo() should be looking - for the $TODO variable. If you want to be sure, tell it explicitly -@@ -1569,14 +1701,134 @@ +-for the $TODO variable. If you want to be sure, tell it explicitly ++for the C<$TODO> variable. If you want to be sure, tell it explicitly + what $pack to use. + =cut sub todo { - my($self, $pack) = @_; + my( $self, $pack ) = @_; ++ ++ return $self->{Todo} if defined $self->{Todo}; - $pack = $pack || $self->exported_to || $self->caller($Level); - return 0 unless $pack; -+ return $self->{Todo} if defined $self->{Todo}; -+ + local $Level = $Level + 1; + my $todo = $self->find_TODO($pack); + return $todo if defined $todo; @@ -2272,8 +2632,8 @@ diff -urN perl-5.10.0.orig/lib/Test/Builder.pm perl-5.10.0/lib/Test/Builder.pm + my $todo_reason = $Test->find_TODO(); + my $todo_reason = $Test->find_TODO($pack): + -+Like C<> but only returns the value of C<<$TODO>> ignoring -+C<>. ++Like C but only returns the value of C<$TODO> ignoring ++C. + +=cut + @@ -2387,14 +2747,17 @@ diff -urN perl-5.10.0.orig/lib/Test/Builder.pm perl-5.10.0/lib/Test/Builder.pm } =item B -@@ -1587,13 +1839,22 @@ - - Like the normal caller(), except it reports according to your level(). +@@ -1585,15 +1959,24 @@ + my($pack, $file, $line) = $Test->caller; + my($pack, $file, $line) = $Test->caller($height); -+C<$height> will be added to the level(). +-Like the normal caller(), except it reports according to your level(). ++Like the normal C, except it reports according to your C. + -+If caller() winds up off the top of the stack it report the highest context. ++C<$height> will be added to the C. + ++If C winds up off the top of the stack it report the highest context. + =cut -sub caller { @@ -2413,7 +2776,7 @@ diff -urN perl-5.10.0.orig/lib/Test/Builder.pm perl-5.10.0/lib/Test/Builder.pm return wantarray ? @caller : $caller[0]; } -@@ -1619,11 +1880,13 @@ +@@ -1619,126 +2002,116 @@ sub _sanity_check { my $self = shift; @@ -2423,8 +2786,6 @@ diff -urN perl-5.10.0.orig/lib/Test/Builder.pm perl-5.10.0/lib/Test/Builder.pm - $self->_whoa($self->{Curr_Test} != @{ $self->{Test_Results} }, - 'Somehow you got a different number of results than tests ran!'); + $self->_whoa( $self->{Curr_Test} < 0, 'Says here you ran a negative number of tests!' ); -+ $self->_whoa( !$self->{Have_Plan} and $self->{Curr_Test}, -+ 'Somehow your tests ran without a plan!' ); + $self->_whoa( $self->{Curr_Test} != @{ $self->{Test_Results} }, + 'Somehow you got a different number of results than tests ran!' ); + @@ -2432,7 +2793,15 @@ diff -urN perl-5.10.0.orig/lib/Test/Builder.pm perl-5.10.0/lib/Test/Builder.pm } =item B<_whoa> -@@ -1637,14 +1900,16 @@ + + $self->_whoa($check, $description); + +-A sanity check, similar to assert(). If the $check is true, something +-has gone horribly wrong. It will die with the given $description and ++A sanity check, similar to C. If the C<$check> is true, something ++has gone horribly wrong. It will die with the given C<$description> and + a note to contact the author. + =cut sub _whoa { @@ -2451,7 +2820,17 @@ diff -urN perl-5.10.0.orig/lib/Test/Builder.pm perl-5.10.0/lib/Test/Builder.pm } =item B<_my_exit> -@@ -1659,52 +1924,43 @@ + + _my_exit($exit_num); + +-Perl seems to have some trouble with exiting inside an END block. 5.005_03 +-and 5.6.1 both seem to do odd things. Instead, this function edits $? +-directly. It should ONLY be called from inside an END block. It ++Perl seems to have some trouble with exiting inside an C block. 5.005_03 ++and 5.6.1 both seem to do odd things. Instead, this function edits C<$?> ++directly. It should B be called from inside an C block. It + doesn't actually exit, that's your job. + =cut sub _my_exit { @@ -2483,8 +2862,8 @@ diff -urN perl-5.10.0.orig/lib/Test/Builder.pm perl-5.10.0/lib/Test/Builder.pm sub _ending { my $self = shift; +- $self->_sanity_check(); + my $real_exit_code = $?; - $self->_sanity_check(); # Don't bother with an ending if this is a forked copy. Only the parent # should do the ending. @@ -2493,6 +2872,11 @@ diff -urN perl-5.10.0.orig/lib/Test/Builder.pm perl-5.10.0/lib/Test/Builder.pm + return; + } + ++ # Ran tests but never declared a plan or hit done_testing ++ if( !$self->{Have_Plan} and $self->{Curr_Test} ) { ++ $self->diag("Tests were run but no plan was declared and done_testing() was not seen."); ++ } ++ + # Exit if plan() was never called. This is so "require Test::Simple" # doesn't puke. + if( !$self->{Have_Plan} ) { @@ -2517,8 +2901,11 @@ diff -urN perl-5.10.0.orig/lib/Test/Builder.pm perl-5.10.0/lib/Test/Builder.pm + if(@$test_results) { # The plan? We have no plan. if( $self->{No_Plan} ) { - $self->_print("1..$self->{Curr_Test}\n") unless $self->no_header; -@@ -1714,31 +1970,24 @@ +- $self->_print("1..$self->{Curr_Test}\n") unless $self->no_header; ++ $self->_output_plan($self->{Curr_Test}) unless $self->no_header; + $self->{Expected_Tests} = $self->{Curr_Test}; + } + # Auto-extended arrays and elements which aren't explicitly # filled in with a shared reference will puke under 5.8.0 # ithreads. So we have to fill them in by hand. :( @@ -2556,7 +2943,7 @@ diff -urN perl-5.10.0.orig/lib/Test/Builder.pm perl-5.10.0/lib/Test/Builder.pm my $num_tests = $self->{Curr_Test}; my $s = $num_failed == 1 ? '' : 's'; -@@ -1749,16 +1998,16 @@ +@@ -1749,16 +2122,16 @@ FAIL } @@ -2577,7 +2964,7 @@ diff -urN perl-5.10.0.orig/lib/Test/Builder.pm perl-5.10.0/lib/Test/Builder.pm $exit_code = $num_failed <= 254 ? $num_failed : 254; } elsif( $num_extra != 0 ) { -@@ -1768,21 +2017,23 @@ +@@ -1768,21 +2141,23 @@ $exit_code = 0; } @@ -2609,7 +2996,43 @@ diff -urN perl-5.10.0.orig/lib/Test/Builder.pm perl-5.10.0/lib/Test/Builder.pm } END { -@@ -1836,8 +2087,8 @@ +@@ -1807,12 +2182,11 @@ + + If you fail more than 254 tests, it will be reported as 254. + +- + =head1 THREADS + + In perl 5.8.1 and later, Test::Builder is thread-safe. The test + number is shared amongst all threads. This means if one thread sets +-the test number using current_test() they will all be effected. ++the test number using C they will all be effected. + + While versions earlier than 5.8.1 had threads they contain too many + bugs to support. +@@ -1820,6 +2194,21 @@ + Test::Builder is only thread-aware if threads.pm is loaded I + Test::Builder. + ++=head1 MEMORY ++ ++An informative hash, accessable via C<>, is stored for each ++test you perform. So memory usage will scale linearly with each test ++run. Although this is not a problem for most test suites, it can ++become an issue if you do large (hundred thousands to million) ++combinatorics tests in the same run. ++ ++In such cases, you are advised to either split the test file into smaller ++ones, or use a reverse approach, doing "normal" (code) compares and ++triggering fail() should anything go unexpected. ++ ++Future versions of Test::Builder will have a way to turn history off. ++ ++ + =head1 EXAMPLES + + CPAN can provide the best examples. Test::Simple, Test::More, +@@ -1836,10 +2225,10 @@ =head1 COPYRIGHT @@ -2618,19 +3041,21 @@ diff -urN perl-5.10.0.orig/lib/Test/Builder.pm perl-5.10.0/lib/Test/Builder.pm +Copyright 2002-2008 by chromatic Echromatic@wgz.orgE and + Michael G Schwern Eschwern@pobox.comE. - This program is free software; you can redistribute it and/or +-This program is free software; you can redistribute it and/or ++This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. -@@ -1847,3 +2098,4 @@ + + See F +@@ -1847,3 +2236,4 @@ =cut 1; + diff -urN perl-5.10.0.orig/lib/Test/More.pm perl-5.10.0/lib/Test/More.pm --- perl-5.10.0.orig/lib/Test/More.pm 2007-12-18 11:47:07.000000000 +0100 -+++ perl-5.10.0/lib/Test/More.pm 2009-02-17 17:16:40.000000000 +0100 ++++ perl-5.10.0/lib/Test/More.pm 2009-08-26 06:14:11.000000000 +0200 @@ -1,39 +1,40 @@ package Test::More; -+# $Id$ -use 5.004; - @@ -2658,7 +3083,7 @@ diff -urN perl-5.10.0.orig/lib/Test/More.pm perl-5.10.0/lib/Test/More.pm -use vars qw($VERSION @ISA @EXPORT %EXPORT_TAGS $TODO); -$VERSION = '0.72'; -$VERSION = eval $VERSION; # make the alpha version come out as a number -+our $VERSION = '0.86'; ++our $VERSION = '0.92'; +$VERSION = eval $VERSION; ## no critic (BuiltinFunctions::ProhibitStringyEval) use Test::Builder::Module; @@ -2685,6 +3110,7 @@ diff -urN perl-5.10.0.orig/lib/Test/More.pm perl-5.10.0/lib/Test/More.pm + eq_array eq_hash eq_set + $TODO + plan ++ done_testing + can_ok isa_ok new_ok + diag note explain + BAIL_OUT @@ -2692,7 +3118,54 @@ diff -urN perl-5.10.0.orig/lib/Test/More.pm perl-5.10.0/lib/Test/More.pm =head1 NAME -@@ -159,10 +160,9 @@ +@@ -43,9 +44,9 @@ + + use Test::More tests => 23; + # or +- use Test::More qw(no_plan); +- # or + use Test::More skip_all => $reason; ++ # or ++ use Test::More; # see done_testing() + + BEGIN { use_ok( 'Some::Module' ); } + require_ok( 'Some::Module' ); +@@ -95,7 +96,7 @@ + =head1 DESCRIPTION + + B If you're just getting started writing tests, have a look at +-Test::Simple first. This is a drop in replacement for Test::Simple ++L first. This is a drop in replacement for Test::Simple + which you can switch to once you get the hang of basic testing. + + The purpose of this module is to provide a wide range of testing +@@ -115,14 +116,19 @@ + + use Test::More tests => 23; + +-There are rare cases when you will not know beforehand how many tests +-your script is going to run. In this case, you can declare that you +-have no plan. (Try to avoid using this as it weakens your test.) ++There are cases when you will not know beforehand how many tests your ++script is going to run. In this case, you can declare your tests at ++the end. ++ ++ use Test::More; ++ ++ ... run your tests ... + +- use Test::More qw(no_plan); ++ done_testing( $number_of_tests_run ); + +-B: using no_plan requires a Test::Harness upgrade else it will +-think everything has failed. See L). ++Sometimes you really don't know how many tests were run, or it's too ++difficult to calculate. In which case you can leave off ++$number_of_tests_run. + + In some cases, you'll want to completely skip an entire testing script. + +@@ -159,10 +165,9 @@ sub plan { my $tb = Test::More->builder; @@ -2704,7 +3177,7 @@ diff -urN perl-5.10.0.orig/lib/Test/More.pm perl-5.10.0/lib/Test/More.pm # This implements "use Test::More 'no_diag'" but the behavior is # deprecated. sub import_extra { -@@ -170,7 +170,7 @@ +@@ -170,7 +175,7 @@ my $list = shift; my @other = (); @@ -2713,18 +3186,43 @@ diff -urN perl-5.10.0.orig/lib/Test/More.pm perl-5.10.0/lib/Test/More.pm while( $idx <= $#{$list} ) { my $item = $list->[$idx]; -@@ -185,8 +185,9 @@ +@@ -185,8 +190,35 @@ } @$list = @other; --} - ++ + return; + } + ++=over 4 ++ ++=item B ++ ++ done_testing(); ++ done_testing($number_of_tests); ++ ++If you don't know how many tests you're going to run, you can issue ++the plan when you're done running tests. ++ ++$number_of_tests is the same as plan(), it's the number of tests you ++expected to run. You can omit this, in which case the number of tests ++you ran doesn't matter, just the fact that your tests ran to ++conclusion. ++ ++This is safer than and replaces the "no_plan" plan. ++ ++=back ++ ++=cut ++ ++sub done_testing { ++ my $tb = Test::More->builder; ++ $tb->done_testing(@_); +} =head2 Test names -@@ -257,10 +258,10 @@ +@@ -257,10 +289,10 @@ =cut sub ok ($;$) { @@ -2737,7 +3235,25 @@ diff -urN perl-5.10.0.orig/lib/Test/More.pm perl-5.10.0/lib/Test/More.pm } =item B -@@ -326,18 +327,17 @@ +@@ -318,6 +350,17 @@ + + ok( exists $brooklyn{tree}, 'A tree grows in Brooklyn' ); + ++A simple call to isnt() usually does not provide a strong test but there ++are cases when you cannot say much more about a value than that it is ++different from some other value: ++ ++ new_ok $obj, "Foo"; ++ ++ my $clone = $obj->clone; ++ isa_ok $obj, "Foo", "Foo->clone"; ++ ++ isnt $obj, $clone, "clone() produces a different object"; ++ + For those grammatical pedants out there, there's an C + function which is an alias of isnt(). + +@@ -326,18 +369,17 @@ sub is ($$;$) { my $tb = Test::More->builder; @@ -2758,7 +3274,7 @@ diff -urN perl-5.10.0.orig/lib/Test/More.pm perl-5.10.0/lib/Test/More.pm =item B like( $got, qr/expected/, $test_name ); -@@ -371,10 +371,9 @@ +@@ -371,10 +413,9 @@ sub like ($$;$) { my $tb = Test::More->builder; @@ -2770,7 +3286,7 @@ diff -urN perl-5.10.0.orig/lib/Test/More.pm perl-5.10.0/lib/Test/More.pm =item B unlike( $got, qr/expected/, $test_name ); -@@ -387,10 +386,9 @@ +@@ -387,10 +428,9 @@ sub unlike ($$;$) { my $tb = Test::More->builder; @@ -2782,7 +3298,18 @@ diff -urN perl-5.10.0.orig/lib/Test/More.pm perl-5.10.0/lib/Test/More.pm =item B cmp_ok( $got, $op, $expected, $test_name ); -@@ -427,10 +425,9 @@ +@@ -422,15 +462,20 @@ + + cmp_ok( $big_hairy_number, '==', $another_big_hairy_number ); + ++It's especially useful when comparing greater-than or smaller-than ++relation between values: ++ ++ cmp_ok( $some_value, '<=', $upper_limit ); ++ ++ + =cut + sub cmp_ok($$$;$) { my $tb = Test::More->builder; @@ -2794,7 +3321,7 @@ diff -urN perl-5.10.0.orig/lib/Test/More.pm perl-5.10.0/lib/Test/More.pm =item B can_ok($module, @methods); -@@ -461,17 +458,17 @@ +@@ -461,17 +506,17 @@ =cut sub can_ok ($@) { @@ -2815,7 +3342,7 @@ diff -urN perl-5.10.0.orig/lib/Test/More.pm perl-5.10.0/lib/Test/More.pm my $ok = $tb->ok( 0, "$class->can(...)" ); $tb->diag(' can_ok() called with no methods'); return $ok; -@@ -479,16 +476,15 @@ +@@ -479,24 +524,24 @@ my @nok = (); foreach my $method (@methods) { @@ -2836,7 +3363,29 @@ diff -urN perl-5.10.0.orig/lib/Test/More.pm perl-5.10.0/lib/Test/More.pm return $ok; } -@@ -523,7 +519,7 @@ + + =item B + +- isa_ok($object, $class, $object_name); +- isa_ok($ref, $type, $ref_name); ++ isa_ok($object, $class, $object_name); ++ isa_ok($subclass, $class, $object_name); ++ isa_ok($ref, $type, $ref_name); + + Checks to see if the given C<< $object->isa($class) >>. Also checks to make + sure the object was defined in the first place. Handy for this sort +@@ -512,6 +557,10 @@ + + to safeguard against your test script blowing up. + ++You can also test a class, to make sure that it has the right ancestor: ++ ++ isa_ok( 'Vole', 'Rodent' ); ++ + It works on references, too: + + isa_ok( $array_ref, 'ARRAY' ); +@@ -523,46 +572,52 @@ =cut sub isa_ok ($$;$) { @@ -2845,9 +3394,18 @@ diff -urN perl-5.10.0.orig/lib/Test/More.pm perl-5.10.0/lib/Test/More.pm my $tb = Test::More->builder; my $diag; -@@ -537,15 +533,16 @@ +- $obj_name = 'The object' unless defined $obj_name; +- my $name = "$obj_name isa $class"; ++ + if( !defined $object ) { ++ $obj_name = 'The thing' unless defined $obj_name; + $diag = "$obj_name isn't defined"; } +- elsif( !ref $object ) { +- $diag = "$obj_name isn't a reference"; +- } else { ++ my $whatami = ref $object ? 'object' : 'class'; # We can't use UNIVERSAL::isa because we want to honor isa() overrides - my($rslt, $error) = $tb->_try(sub { $object->isa($class) }); - if( $error ) { @@ -2856,30 +3414,48 @@ diff -urN perl-5.10.0.orig/lib/Test/More.pm perl-5.10.0/lib/Test/More.pm if( $error =~ /^Can't call method "isa" on unblessed reference/ ) { # Its an unblessed reference - if( !UNIVERSAL::isa($object, $class) ) { ++ $obj_name = 'The reference' unless defined $obj_name; + if( !UNIVERSAL::isa( $object, $class ) ) { my $ref = ref $object; $diag = "$obj_name isn't a '$class' it's a '$ref'"; } - } else { + } ++ elsif( $error =~ /Can't call method "isa" without a package/ ) { ++ # It's something that can't even be a class ++ $diag = "$obj_name isn't a class or reference"; ++ } + else { die <isa on your object and got some weird error. +-WHOA! I tried to call ->isa on your object and got some weird error. ++WHOA! I tried to call ->isa on your $whatami and got some weird error. Here's the error. -@@ -558,11 +555,9 @@ - $diag = "$obj_name isn't a '$class' it's a '$ref'"; + $error + WHOA + } + } +- elsif( !$rslt ) { +- my $ref = ref $object; +- $diag = "$obj_name isn't a '$class' it's a '$ref'"; ++ else { ++ $obj_name = "The $whatami" unless defined $obj_name; ++ if( !$rslt ) { ++ my $ref = ref $object; ++ $diag = "$obj_name isn't a '$class' it's a '$ref'"; ++ } } } - - ++ my $name = "$obj_name isa $class"; my $ok; - if( $diag ) { + if($diag) { $ok = $tb->ok( 0, $name ); $tb->diag(" $diag\n"); } -@@ -573,6 +568,49 @@ +@@ -573,6 +628,49 @@ return $ok; } @@ -2929,7 +3505,7 @@ diff -urN perl-5.10.0.orig/lib/Test/More.pm perl-5.10.0/lib/Test/More.pm =item B -@@ -593,12 +631,14 @@ +@@ -593,12 +691,14 @@ sub pass (;$) { my $tb = Test::More->builder; @@ -2946,7 +3522,7 @@ diff -urN perl-5.10.0.orig/lib/Test/More.pm perl-5.10.0/lib/Test/More.pm } =back -@@ -653,38 +693,40 @@ +@@ -653,38 +753,40 @@ =cut sub use_ok ($;@) { @@ -2998,7 +3574,7 @@ diff -urN perl-5.10.0.orig/lib/Test/More.pm perl-5.10.0/lib/Test/More.pm DIAGNOSTIC } -@@ -692,6 +734,24 @@ +@@ -692,6 +794,24 @@ return $ok; } @@ -3023,7 +3599,7 @@ diff -urN perl-5.10.0.orig/lib/Test/More.pm perl-5.10.0/lib/Test/More.pm =item B require_ok($module); -@@ -711,20 +771,20 @@ +@@ -711,20 +831,20 @@ # Module names must be barewords, files not. $module = qq['$module'] unless _is_module_name($module); @@ -3051,7 +3627,7 @@ diff -urN perl-5.10.0.orig/lib/Test/More.pm perl-5.10.0/lib/Test/More.pm DIAGNOSTIC } -@@ -732,7 +792,6 @@ +@@ -732,7 +852,6 @@ return $ok; } @@ -3059,7 +3635,7 @@ diff -urN perl-5.10.0.orig/lib/Test/More.pm perl-5.10.0/lib/Test/More.pm sub _is_module_name { my $module = shift; -@@ -740,7 +799,8 @@ +@@ -740,7 +859,8 @@ # End with an alphanumeric. # The rest is an alphanumeric or :: $module =~ s/\b::\b//g; @@ -3069,7 +3645,18 @@ diff -urN perl-5.10.0.orig/lib/Test/More.pm perl-5.10.0/lib/Test/More.pm } =back -@@ -778,50 +838,50 @@ +@@ -769,59 +889,59 @@ + references themselves (except for their type) are ignored. This means + aspects such as blessing and ties are not considered "different". + +-is_deeply() current has very limited handling of function reference ++is_deeply() currently has very limited handling of function reference + and globs. It merely checks if they have the same referent. This may + improve in the future. + +-Test::Differences and Test::Deep provide more in-depth functionality ++L and L provide more in-depth functionality + along these lines. =cut @@ -3138,7 +3725,7 @@ diff -urN perl-5.10.0.orig/lib/Test/More.pm perl-5.10.0/lib/Test/More.pm } } -@@ -831,11 +891,11 @@ +@@ -831,11 +951,11 @@ sub _format_stack { my(@Stack) = @_; @@ -3152,7 +3739,7 @@ diff -urN perl-5.10.0.orig/lib/Test/More.pm perl-5.10.0/lib/Test/More.pm if( $type eq 'HASH' ) { $var .= "->" unless $did_arrow++; $var .= "{$idx}"; -@@ -849,18 +909,19 @@ +@@ -849,18 +969,19 @@ } } @@ -3180,7 +3767,7 @@ diff -urN perl-5.10.0.orig/lib/Test/More.pm perl-5.10.0/lib/Test/More.pm } $out .= "$vars[0] = $vals[0]\n"; -@@ -870,14 +931,13 @@ +@@ -870,14 +991,13 @@ return $out; } @@ -3196,7 +3783,7 @@ diff -urN perl-5.10.0.orig/lib/Test/More.pm perl-5.10.0/lib/Test/More.pm } return ''; -@@ -903,6 +963,8 @@ +@@ -903,6 +1023,8 @@ test output. Like C @diagnostic_message is simply concatenated together. @@ -3205,7 +3792,7 @@ diff -urN perl-5.10.0.orig/lib/Test/More.pm perl-5.10.0/lib/Test/More.pm Handy for this sort of thing: ok( grep(/foo/, @users), "There's a foo user" ) or -@@ -922,14 +984,49 @@ +@@ -922,14 +1044,49 @@ changing, but it is guaranteed that whatever you throw at it it won't interfere with the test. @@ -3238,7 +3825,7 @@ diff -urN perl-5.10.0.orig/lib/Test/More.pm perl-5.10.0/lib/Test/More.pm + my @dump = explain @diagnostic_message; + +Will dump the contents of any references in a human readable format. -+Usually you want to pass this into C or C. ++Usually you want to pass this into C or C. + +Handy for things like... + @@ -3257,7 +3844,7 @@ diff -urN perl-5.10.0.orig/lib/Test/More.pm perl-5.10.0/lib/Test/More.pm =back -@@ -993,9 +1090,9 @@ +@@ -993,9 +1150,9 @@ =cut @@ -3269,7 +3856,7 @@ diff -urN perl-5.10.0.orig/lib/Test/More.pm perl-5.10.0/lib/Test/More.pm my $tb = Test::More->builder; unless( defined $how_many ) { -@@ -1006,19 +1103,19 @@ +@@ -1006,19 +1163,19 @@ } if( defined $how_many and $how_many =~ /\D/ ) { @@ -3293,7 +3880,7 @@ diff -urN perl-5.10.0.orig/lib/Test/More.pm perl-5.10.0/lib/Test/More.pm =item B TODO: { -@@ -1081,7 +1178,7 @@ +@@ -1081,7 +1238,7 @@ =cut sub todo_skip { @@ -3302,7 +3889,7 @@ diff -urN perl-5.10.0.orig/lib/Test/More.pm perl-5.10.0/lib/Test/More.pm my $tb = Test::More->builder; unless( defined $how_many ) { -@@ -1091,11 +1188,11 @@ +@@ -1091,11 +1248,11 @@ $how_many = 1; } @@ -3316,7 +3903,13 @@ diff -urN perl-5.10.0.orig/lib/Test/More.pm perl-5.10.0/lib/Test/More.pm last TODO; } -@@ -1135,7 +1232,7 @@ +@@ -1131,11 +1288,13 @@ + + The test will exit with 255. + ++For even better control look at L. ++ + =cut sub BAIL_OUT { my $reason = shift; @@ -3325,7 +3918,7 @@ diff -urN perl-5.10.0.orig/lib/Test/More.pm perl-5.10.0/lib/Test/More.pm $tb->BAIL_OUT($reason); } -@@ -1174,14 +1271,14 @@ +@@ -1174,14 +1333,14 @@ #'# sub eq_array { @@ -3344,7 +3937,7 @@ diff -urN perl-5.10.0.orig/lib/Test/More.pm perl-5.10.0/lib/Test/More.pm warn "eq_array passed a non-array ref"; return 0; } -@@ -1190,12 +1287,12 @@ +@@ -1190,12 +1349,12 @@ my $ok = 1; my $max = $#$a1 > $#$a2 ? $#$a1 : $#$a2; @@ -3360,7 +3953,7 @@ diff -urN perl-5.10.0.orig/lib/Test/More.pm perl-5.10.0/lib/Test/More.pm pop @Data_Stack if $ok; last unless $ok; -@@ -1205,7 +1302,7 @@ +@@ -1205,7 +1364,7 @@ } sub _deep_check { @@ -3369,7 +3962,7 @@ diff -urN perl-5.10.0.orig/lib/Test/More.pm perl-5.10.0/lib/Test/More.pm my $tb = Test::More->builder; my $ok = 0; -@@ -1217,27 +1314,27 @@ +@@ -1217,27 +1376,31 @@ { # Quiet uninitialized value warnings when comparing undefs. @@ -3389,6 +3982,10 @@ diff -urN perl-5.10.0.orig/lib/Test/More.pm perl-5.10.0/lib/Test/More.pm $ok = 0; } - elsif ( _dne($e1) xor _dne($e2) ) { ++ elsif( !defined $e1 and !defined $e2 ) { ++ # Shortcut if they're both defined. ++ $ok = 1; ++ } + elsif( _dne($e1) xor _dne($e2) ) { $ok = 0; } @@ -3407,7 +4004,7 @@ diff -urN perl-5.10.0.orig/lib/Test/More.pm perl-5.10.0/lib/Test/More.pm else { if( $Refs_Seen{$e1} ) { return $Refs_Seen{$e1} eq $e2; -@@ -1250,50 +1347,48 @@ +@@ -1250,50 +1413,48 @@ $type = 'DIFFERENT' unless _type($e2) eq $type; if( $type eq 'DIFFERENT' ) { @@ -3473,7 +4070,7 @@ diff -urN perl-5.10.0.orig/lib/Test/More.pm perl-5.10.0/lib/Test/More.pm =item B my $is_eq = eq_hash(\%got, \%expected); -@@ -1304,14 +1399,14 @@ +@@ -1304,14 +1465,14 @@ =cut sub eq_hash { @@ -3491,7 +4088,7 @@ diff -urN perl-5.10.0.orig/lib/Test/More.pm perl-5.10.0/lib/Test/More.pm warn "eq_hash passed a non-hash ref"; return 0; } -@@ -1320,12 +1415,12 @@ +@@ -1320,12 +1481,12 @@ my $ok = 1; my $bigger = keys %$a1 > keys %$a2 ? $a1 : $a2; @@ -3507,7 +4104,12 @@ diff -urN perl-5.10.0.orig/lib/Test/More.pm perl-5.10.0/lib/Test/More.pm pop @Data_Stack if $ok; last unless $ok; -@@ -1360,14 +1455,13 @@ +@@ -1356,18 +1517,17 @@ + + eq_set([\1, \2], [\2, \1]); + +-Test::Deep contains much better set comparison functions. ++L contains much better set comparison functions. =cut @@ -3526,7 +4128,7 @@ diff -urN perl-5.10.0.orig/lib/Test/More.pm perl-5.10.0/lib/Test/More.pm # sorted with the same algorithm. # # Ensure that references are not accidentally treated the same as a -@@ -1379,8 +1473,8 @@ +@@ -1379,8 +1539,8 @@ # I don't know how references would be sorted so we just don't sort # them. This means eq_set doesn't really work with refs. return eq_array( @@ -3537,16 +4139,60 @@ diff -urN perl-5.10.0.orig/lib/Test/More.pm perl-5.10.0/lib/Test/More.pm ); } -@@ -1438,7 +1532,7 @@ +@@ -1438,7 +1598,25 @@ =item Backwards compatibility -Test::More works with Perls as old as 5.004_05. +Test::More works with Perls as old as 5.6.0. ++ ++ ++=item utf8 / "Wide character in print" ++ ++If you use utf8 or other non-ASCII characters with Test::More you ++might get a "Wide character in print" warning. Using C will not fix it. Test::Builder (which powers ++Test::More) duplicates STDOUT and STDERR. So any changes to them, ++including changing their output disciplines, will not be seem by ++Test::More. ++ ++The work around is to change the filehandles used by Test::Builder ++directly. ++ ++ my $builder = Test::More->builder; ++ binmode $builder->output, ":utf8"; ++ binmode $builder->failure_output, ":utf8"; ++ binmode $builder->todo_output, ":utf8"; =item Overloaded objects -@@ -1506,21 +1600,21 @@ +@@ -1452,7 +1630,7 @@ + + However, it does mean that functions like is_deeply() cannot be used to + test the internals of string overloaded objects. In this case I would +-suggest Test::Deep which contains more flexible testing functions for ++suggest L which contains more flexible testing functions for + complex data structures. + + +@@ -1474,11 +1652,11 @@ + + =item Test::Harness upgrade + +-no_plan and todo depend on new Test::Harness features and fixes. If +-you're going to distribute tests that use no_plan or todo your +-end-users will have to upgrade Test::Harness to the latest one on +-CPAN. If you avoid no_plan and TODO tests, the stock Test::Harness +-will work fine. ++no_plan, todo and done_testing() depend on new Test::Harness features ++and fixes. If you're going to distribute tests that use no_plan or ++todo your end-users will have to upgrade Test::Harness to the latest ++one on CPAN. If you avoid no_plan and TODO tests, the stock ++Test::Harness will work fine. + + Installing Test::More should also upgrade Test::Harness. + +@@ -1506,21 +1684,21 @@ some tests. You can upgrade to Test::More later (it's forward compatible). @@ -3576,8 +4222,16 @@ diff -urN perl-5.10.0.orig/lib/Test/More.pm perl-5.10.0/lib/Test/More.pm L shows the idea of embedded testing. L installs a whole bunch of useful test modules. -@@ -1541,7 +1635,7 @@ +@@ -1539,9 +1717,15 @@ + See F to report and view bugs. + ++=head1 SOURCE ++ ++The source code repository for Test::More can be found at ++F. ++ ++ =head1 COPYRIGHT -Copyright 2001-2002, 2004-2006 by Michael G Schwern Eschwern@pobox.comE. @@ -3587,8 +4241,69 @@ diff -urN perl-5.10.0.orig/lib/Test/More.pm perl-5.10.0/lib/Test/More.pm modify it under the same terms as Perl itself. diff -urN perl-5.10.0.orig/lib/Test/Simple/Changes perl-5.10.0/lib/Test/Simple/Changes --- perl-5.10.0.orig/lib/Test/Simple/Changes 2007-12-18 11:47:07.000000000 +0100 -+++ perl-5.10.0/lib/Test/Simple/Changes 2009-02-17 17:16:40.000000000 +0100 -@@ -1,8 +1,165 @@ ++++ perl-5.10.0/lib/Test/Simple/Changes 2009-08-26 06:14:11.000000000 +0200 +@@ -1,8 +1,226 @@ ++0.92 Fri Jul 3 11:08:56 PDT 2009 ++ Test Fixes ++ * Silence noise on VMS in exit.t (Craig Berry) ++ * Skip Builder/fork_with_new_stdout.t on systems without fork (Craig Berry) ++ ++ ++0.90 Thu Jul 2 13:18:25 PDT 2009 ++ Docs ++ * Finally added a note about the "Wide character in print" warning and ++ how to work around it. ++ * Note the IO::Stringy license in our copy of it. ++ [test-more.googlecode.com 47] ++ ++ Test Fixes ++ * Small fixes for integration with the Perl core ++ [bleadperl eaa0815147e13cd4ab5b3d6ca8f26544a9f0c3b4] ++ * exit code tests could be effected by errno when PERLIO=stdio ++ [bleadperl c76230386fc5e6fba9fdbeab473abbf4f4adcbe3] ++ ++ Other ++ * This is a stable release for 5.10.1. It does not include ++ the subtest() work in 0.89_01. ++ ++ ++0.88 Sat May 30 12:31:24 PDT 2009 ++ Turing 0.87_03 into a stable release. ++ ++ ++0.87_03 Sun May 24 13:41:40 PDT 2009 ++ New Features ++ * isa_ok() now works on classes. (Peter Scott) ++ ++ ++0.87_02 Sat Apr 11 12:54:14 PDT 2009 ++ Test Fixes ++ * Some filesystems don't like it when you open a file for writing multiple ++ times. Fixes t/Builder/reset.t. [rt.cpan.org 17298] ++ * Check how an operating system is going to map exit codes. Some OS' ++ will map them... sometimes. [rt.cpan.org 42148] ++ * Fix Test::Builder::NoOutput on 5.6.2. ++ ++ ++0.87_01 Sun Mar 29 09:56:52 BST 2009 ++ New Features ++ * done_testing() allows you to declare that you have finished running tests, ++ and how many you ran. It is a safer no_plan and effectively replaces it. ++ * output() now supports scalar references. ++ ++ Feature Changes ++ * You can now run a test without first declaring a plan. This allows ++ done_testing() to work. ++ * You can now call current_test() without first declaring a plan. ++ ++ Bug Fixes ++ * skip_all() with no reason would output "1..0" which is invalid TAP. It will ++ now always include the SKIP directive. ++ ++ Other ++ * Repository moved to github. ++ ++ +0.86 Sun Nov 9 01:09:05 PST 2008 + Same as 0.85_01 + @@ -3756,7 +4471,7 @@ diff -urN perl-5.10.0.orig/lib/Test/Simple/Changes perl-5.10.0/lib/Test/Simple/C 0.71 Thu Sep 13 20:42:36 PDT 2007 Bug fixes -@@ -15,8 +172,8 @@ +@@ -15,8 +233,8 @@ - Removed dependency on Text::Soundex [rt.cpan.org 25022] - Fixed a 5.5.x failure in fail-more.t * Got rid of the annoying sort_bug.t test that revealed problems with some @@ -3769,35 +4484,109 @@ diff -urN perl-5.10.0.orig/lib/Test/Simple/Changes perl-5.10.0/lib/Test/Simple/C - Minor POD mistake in Test::Builder [rt.cpan.org 28869] diff -urN perl-5.10.0.orig/lib/Test/Simple/README perl-5.10.0/lib/Test/Simple/README --- perl-5.10.0.orig/lib/Test/Simple/README 2007-12-18 11:47:07.000000000 +0100 -+++ perl-5.10.0/lib/Test/Simple/README 2009-02-17 17:16:40.000000000 +0100 -@@ -1,3 +1,4 @@ -+# $Id$ - This is the README file for Test::Simple, basic utilities for - writing tests, by Michael G Schwern . - -diff -urN perl-5.10.0.orig/lib/Test/Simple/TODO perl-5.10.0/lib/Test/Simple/TODO ---- perl-5.10.0.orig/lib/Test/Simple/TODO 2007-12-18 11:47:07.000000000 +0100 -+++ perl-5.10.0/lib/Test/Simple/TODO 2009-02-17 17:16:40.000000000 +0100 -@@ -1,3 +1,4 @@ -+# $Id$ - See https://rt.cpan.org/NoAuth/Bugs.html?Dist=Test-Simple plus here's - a few more I haven't put in RT yet. - -diff -urN perl-5.10.0.orig/lib/Test/Simple/t/00test_harness_check.t perl-5.10.0/lib/Test/Simple/t/00test_harness_check.t ---- perl-5.10.0.orig/lib/Test/Simple/t/00test_harness_check.t 2007-12-18 11:47:07.000000000 +0100 -+++ perl-5.10.0/lib/Test/Simple/t/00test_harness_check.t 2009-02-17 17:16:40.000000000 +0100 -@@ -1,4 +1,5 @@ - #!/usr/bin/perl -w -+# $Id$ - - # A test to make sure the new Test::Harness was installed properly. ++++ perl-5.10.0/lib/Test/Simple/README 2009-08-26 06:14:11.000000000 +0200 +@@ -13,3 +13,10 @@ + make + make test + make install ++ ++It requires Perl version 5.6.0 or newer and Test::Harness 2.03 or newer. ++ ++ ++* More Info ++ ++More information can be found at http://test-more.googlecode.com/ +diff -urN perl-5.10.0.orig/lib/Test/Simple/t/bad_plan.t perl-5.10.0/lib/Test/Simple/t/bad_plan.t +--- perl-5.10.0.orig/lib/Test/Simple/t/bad_plan.t 2007-12-18 11:47:07.000000000 +0100 ++++ perl-5.10.0/lib/Test/Simple/t/bad_plan.t 2009-08-26 06:14:11.000000000 +0200 +@@ -7,32 +7,17 @@ + } + } + +-my $test_num = 1; +-# Utility testing functions. +-sub ok ($;$) { +- my($test, $name) = @_; +- my $ok = ''; +- $ok .= "not " unless $test; +- $ok .= "ok $test_num"; +- $ok .= " - $name" if defined $name; +- $ok .= "\n"; +- print $ok; +- $test_num++; +- +- return $test; +-} +- +- + use Test::Builder; + my $Test = Test::Builder->new; ++$Test->plan( tests => 2 ); ++$Test->level(0); + +-print "1..2\n"; ++my $tb = Test::Builder->create; + +-eval { $Test->plan(7); }; +-ok( $@ =~ /^plan\(\) doesn't understand 7/, 'bad plan()' ) || ++eval { $tb->plan(7); }; ++$Test->like( $@, qr/^plan\(\) doesn't understand 7/, 'bad plan()' ) || + print STDERR "# $@"; + +-eval { $Test->plan(wibble => 7); }; +-ok( $@ =~ /^plan\(\) doesn't understand wibble 7/, 'bad plan()' ) || ++eval { $tb->plan(wibble => 7); }; ++$Test->like( $@, qr/^plan\(\) doesn't understand wibble 7/, 'bad plan()' ) || + print STDERR "# $@"; +- +diff -urN perl-5.10.0.orig/lib/Test/Simple/t/bail_out.t perl-5.10.0/lib/Test/Simple/t/bail_out.t +--- perl-5.10.0.orig/lib/Test/Simple/t/bail_out.t 2007-12-18 11:47:07.000000000 +0100 ++++ perl-5.10.0/lib/Test/Simple/t/bail_out.t 2009-08-26 06:14:11.000000000 +0200 +@@ -18,30 +18,22 @@ + + use Test::Builder; + use Test::More; +-use TieOut; + +-my $output = tie *FAKEOUT, 'TieOut'; ++my $output; + my $TB = Test::More->builder; +-$TB->output(\*FAKEOUT); ++$TB->output(\$output); + + my $Test = Test::Builder->create; + $Test->level(0); + +-if( $] >= 5.005 ) { +- $Test->plan(tests => 3); +-} +-else { +- $Test->plan(skip_all => +- 'CORE::GLOBAL::exit, introduced in 5.005, is needed for testing'); +-} +- ++$Test->plan(tests => 3); + plan tests => 4; + + BAIL_OUT("ROCKS FALL! EVERYONE DIES!"); + + +-$Test->is_eq( $output->read, <<'OUT' ); ++$Test->is_eq( $output, <<'OUT' ); + 1..4 + Bail out! ROCKS FALL! EVERYONE DIES! + OUT diff -urN perl-5.10.0.orig/lib/Test/Simple/t/BEGIN_require_ok.t perl-5.10.0/lib/Test/Simple/t/BEGIN_require_ok.t --- perl-5.10.0.orig/lib/Test/Simple/t/BEGIN_require_ok.t 1970-01-01 01:00:00.000000000 +0100 -+++ perl-5.10.0/lib/Test/Simple/t/BEGIN_require_ok.t 2009-02-17 17:16:40.000000000 +0100 -@@ -0,0 +1,25 @@ ++++ perl-5.10.0/lib/Test/Simple/t/BEGIN_require_ok.t 2009-08-26 06:14:11.000000000 +0200 +@@ -0,0 +1,27 @@ +#!/usr/bin/perl -w -+# $Id$ ++ ++# Fixed a problem with BEGIN { use_ok or require_ok } silently failing when there's no ++# plan set. [rt.cpan.org 28345] Thanks Adriano Ferreira and Yitzchak. ++ ++use strict; + +BEGIN { + if( $ENV{PERL_CORE} ) { @@ -3813,20 +4602,17 @@ diff -urN perl-5.10.0.orig/lib/Test/Simple/t/BEGIN_require_ok.t perl-5.10.0/lib/ + +my $result; +BEGIN { -+ eval { -+ require_ok("Wibble"); -+ }; -+ $result = $@; ++ $result = require_ok("strict"); +} + -+plan tests => 1; -+like $result, '/^You tried to run a test without a plan/'; ++ok $result, "require_ok ran"; ++ ++done_testing(2); diff -urN perl-5.10.0.orig/lib/Test/Simple/t/BEGIN_use_ok.t perl-5.10.0/lib/Test/Simple/t/BEGIN_use_ok.t --- perl-5.10.0.orig/lib/Test/Simple/t/BEGIN_use_ok.t 1970-01-01 01:00:00.000000000 +0100 -+++ perl-5.10.0/lib/Test/Simple/t/BEGIN_use_ok.t 2009-02-17 17:16:40.000000000 +0100 -@@ -0,0 +1,29 @@ ++++ perl-5.10.0/lib/Test/Simple/t/BEGIN_use_ok.t 2009-08-26 06:14:11.000000000 +0200 +@@ -0,0 +1,26 @@ +#!/usr/bin/perl -w -+# $Id$ + +# [rt.cpan.org 28345] +# @@ -3846,68 +4632,15 @@ diff -urN perl-5.10.0.orig/lib/Test/Simple/t/BEGIN_use_ok.t perl-5.10.0/lib/Test + +my $result; +BEGIN { -+ eval { -+ use_ok("Wibble"); -+ }; -+ $result = $@; ++ $result = use_ok("strict"); +} + -+plan tests => 1; -+like $result, '/^You tried to run a test without a plan/'; -diff -urN perl-5.10.0.orig/lib/Test/Simple/t/Builder.t perl-5.10.0/lib/Test/Simple/t/Builder.t ---- perl-5.10.0.orig/lib/Test/Simple/t/Builder.t 2007-12-18 11:47:07.000000000 +0100 -+++ perl-5.10.0/lib/Test/Simple/t/Builder.t 2009-02-17 17:16:40.000000000 +0100 -@@ -1,4 +1,5 @@ - #!/usr/bin/perl -w -+# $Id$ - - BEGIN { - if( $ENV{PERL_CORE} ) { -diff -urN perl-5.10.0.orig/lib/Test/Simple/t/More.t perl-5.10.0/lib/Test/Simple/t/More.t ---- perl-5.10.0.orig/lib/Test/Simple/t/More.t 2007-12-18 11:47:07.000000000 +0100 -+++ perl-5.10.0/lib/Test/Simple/t/More.t 2009-02-17 17:16:40.000000000 +0100 -@@ -1,9 +1,10 @@ - #!perl -w -+# $Id$ - - BEGIN { - if( $ENV{PERL_CORE} ) { - chdir 't'; -- @INC = qw(../lib lib); -+ @INC = qw(../lib lib ../lib/Test/Simple/t/lib); - } - } - -diff -urN perl-5.10.0.orig/lib/Test/Simple/t/bad_plan.t perl-5.10.0/lib/Test/Simple/t/bad_plan.t ---- perl-5.10.0.orig/lib/Test/Simple/t/bad_plan.t 2007-12-18 11:47:07.000000000 +0100 -+++ perl-5.10.0/lib/Test/Simple/t/bad_plan.t 2009-02-17 17:16:40.000000000 +0100 -@@ -1,4 +1,5 @@ - #!/usr/bin/perl -w -+# $Id$ - - BEGIN { - if( $ENV{PERL_CORE} ) { -diff -urN perl-5.10.0.orig/lib/Test/Simple/t/bail_out.t perl-5.10.0/lib/Test/Simple/t/bail_out.t ---- perl-5.10.0.orig/lib/Test/Simple/t/bail_out.t 2007-12-18 11:47:07.000000000 +0100 -+++ perl-5.10.0/lib/Test/Simple/t/bail_out.t 2009-02-17 17:16:40.000000000 +0100 -@@ -1,4 +1,5 @@ - #!/usr/bin/perl -w -+# $Id$ - - BEGIN { - if( $ENV{PERL_CORE} ) { -diff -urN perl-5.10.0.orig/lib/Test/Simple/t/buffer.t perl-5.10.0/lib/Test/Simple/t/buffer.t ---- perl-5.10.0.orig/lib/Test/Simple/t/buffer.t 2007-12-18 11:47:07.000000000 +0100 -+++ perl-5.10.0/lib/Test/Simple/t/buffer.t 2009-02-17 17:16:40.000000000 +0100 -@@ -1,4 +1,5 @@ - #!/usr/bin/perl -+# $Id$ - - BEGIN { - if( $ENV{PERL_CORE} ) { ++ok( $result, "use_ok() ran" ); ++done_testing(2); ++ diff -urN perl-5.10.0.orig/lib/Test/Simple/t/c_flag.t perl-5.10.0/lib/Test/Simple/t/c_flag.t --- perl-5.10.0.orig/lib/Test/Simple/t/c_flag.t 1970-01-01 01:00:00.000000000 +0100 -+++ perl-5.10.0/lib/Test/Simple/t/c_flag.t 2009-02-17 17:16:40.000000000 +0100 ++++ perl-5.10.0/lib/Test/Simple/t/c_flag.t 2009-08-26 06:14:11.000000000 +0200 @@ -0,0 +1,21 @@ +#!/usr/bin/perl -w + @@ -3930,31 +4663,10 @@ diff -urN perl-5.10.0.orig/lib/Test/Simple/t/c_flag.t perl-5.10.0/lib/Test/Simpl +print "1..1\n"; +print "ok 1\n"; + -diff -urN perl-5.10.0.orig/lib/Test/Simple/t/carp.t perl-5.10.0/lib/Test/Simple/t/carp.t ---- perl-5.10.0.orig/lib/Test/Simple/t/carp.t 2007-12-18 11:47:07.000000000 +0100 -+++ perl-5.10.0/lib/Test/Simple/t/carp.t 2009-02-17 17:16:40.000000000 +0100 -@@ -1,4 +1,5 @@ - #!/usr/bin/perl -+# $Id$ - - BEGIN { - if( $ENV{PERL_CORE} ) { -diff -urN perl-5.10.0.orig/lib/Test/Simple/t/circular_data.t perl-5.10.0/lib/Test/Simple/t/circular_data.t ---- perl-5.10.0.orig/lib/Test/Simple/t/circular_data.t 2007-12-18 11:47:07.000000000 +0100 -+++ perl-5.10.0/lib/Test/Simple/t/circular_data.t 2009-02-17 17:16:40.000000000 +0100 -@@ -1,4 +1,5 @@ - #!/usr/bin/perl -w -+# $Id$ - - # Test is_deeply and friends with circular data structures [rt.cpan.org 7289] - diff -urN perl-5.10.0.orig/lib/Test/Simple/t/cmp_ok.t perl-5.10.0/lib/Test/Simple/t/cmp_ok.t --- perl-5.10.0.orig/lib/Test/Simple/t/cmp_ok.t 2007-12-18 11:47:07.000000000 +0100 -+++ perl-5.10.0/lib/Test/Simple/t/cmp_ok.t 2009-02-17 17:17:28.000000000 +0100 -@@ -1,9 +1,10 @@ - #!/usr/bin/perl -w -+# $Id$ - ++++ perl-5.10.0/lib/Test/Simple/t/cmp_ok.t 2009-08-26 06:14:11.000000000 +0200 +@@ -3,7 +3,7 @@ BEGIN { if( $ENV{PERL_CORE} ) { chdir 't'; @@ -3963,7 +4675,7 @@ diff -urN perl-5.10.0.orig/lib/Test/Simple/t/cmp_ok.t perl-5.10.0/lib/Test/Simpl } else { unshift @INC, 't/lib'; -@@ -29,19 +30,19 @@ +@@ -29,19 +29,19 @@ $expect{error} =~ s/ at .*\n?//; local $Test::Builder::Level = $Test::Builder::Level + 1; @@ -3988,7 +4700,7 @@ diff -urN perl-5.10.0.orig/lib/Test/Simple/t/cmp_ok.t perl-5.10.0/lib/Test/Simpl } } -@@ -49,6 +50,10 @@ +@@ -49,6 +49,10 @@ use Test::More; Test::More->builder->no_ending(1); @@ -3999,7 +4711,7 @@ diff -urN perl-5.10.0.orig/lib/Test/Simple/t/cmp_ok.t perl-5.10.0/lib/Test/Simpl my @Tests = ( [1, '==', 1], [1, '==', 2], -@@ -56,23 +61,12 @@ +@@ -56,23 +60,12 @@ ["a", "eq", "a"], [1, "+", 1], [1, "-", 1], @@ -4030,78 +4742,170 @@ diff -urN perl-5.10.0.orig/lib/Test/Simple/t/cmp_ok.t perl-5.10.0/lib/Test/Simpl $TB->plan(tests => @Tests * 2); diff -urN perl-5.10.0.orig/lib/Test/Simple/t/create.t perl-5.10.0/lib/Test/Simple/t/create.t --- perl-5.10.0.orig/lib/Test/Simple/t/create.t 2007-12-18 11:47:07.000000000 +0100 -+++ perl-5.10.0/lib/Test/Simple/t/create.t 2009-02-17 17:16:40.000000000 +0100 -@@ -1,4 +1,5 @@ - #!/usr/bin/perl -w -+# $Id$ ++++ perl-5.10.0/lib/Test/Simple/t/create.t 2009-08-26 06:14:11.000000000 +0200 +@@ -12,8 +12,9 @@ + } + } - #!perl -w +-use Test::More tests => 8; ++use Test::More tests => 7; + use Test::Builder; ++use Test::Builder::NoOutput; + + my $more_tb = Test::More->builder; + isa_ok $more_tb, 'Test::Builder'; +@@ -22,24 +23,18 @@ + is $more_tb, Test::Builder->new, ' does not interfere with ->new'; + + { +- my $new_tb = Test::Builder->create; ++ my $new_tb = Test::Builder::NoOutput->create; + isa_ok $new_tb, 'Test::Builder'; + isnt $more_tb, $new_tb, 'Test::Builder->create makes a new object'; + +- $new_tb->output("some_file"); +- END { 1 while unlink "some_file" } +- + $new_tb->plan(tests => 1); +- $new_tb->ok(1); +-} +- +-pass("Changing output() of new TB doesn't interfere with singleton"); ++ $new_tb->ok(1, "a test"); + +-ok open FILE, "some_file"; +-is join("", ), <read, <<'OUT'; + 1..1 +-ok 1 ++ok 1 - a test + OUT ++} + +-close FILE; ++pass("Changing output() of new TB doesn't interfere with singleton"); +diff -urN perl-5.10.0.orig/lib/Test/Simple/t/current_test.t perl-5.10.0/lib/Test/Simple/t/current_test.t +--- perl-5.10.0.orig/lib/Test/Simple/t/current_test.t 1970-01-01 01:00:00.000000000 +0100 ++++ perl-5.10.0/lib/Test/Simple/t/current_test.t 2009-08-26 06:14:11.000000000 +0200 +@@ -0,0 +1,11 @@ ++#!/usr/bin/perl -w ++ ++# Dave Rolsky found a bug where if current_test() is used and no ++# tests are run via Test::Builder it will blow up. ++ ++use Test::Builder; ++$TB = Test::Builder->new; ++$TB->plan(tests => 2); ++print "ok 1\n"; ++print "ok 2\n"; ++$TB->current_test(2); +diff -urN perl-5.10.0.orig/lib/Test/Simple/t/current_test_without_plan.t perl-5.10.0/lib/Test/Simple/t/current_test_without_plan.t +--- perl-5.10.0.orig/lib/Test/Simple/t/current_test_without_plan.t 1970-01-01 01:00:00.000000000 +0100 ++++ perl-5.10.0/lib/Test/Simple/t/current_test_without_plan.t 2009-08-26 06:14:11.000000000 +0200 +@@ -0,0 +1,16 @@ ++#!/usr/bin/perl -w ++ ++# Test that current_test() will work without a declared plan. ++ ++use Test::Builder; ++ ++my $tb = Test::Builder->new; ++$tb->current_test(2); ++print <<'END'; ++ok 1 ++ok 2 ++END ++ ++$tb->ok(1, "Third test"); ++ ++$tb->done_testing(3); diff -urN perl-5.10.0.orig/lib/Test/Simple/t/curr_test.t perl-5.10.0/lib/Test/Simple/t/curr_test.t --- perl-5.10.0.orig/lib/Test/Simple/t/curr_test.t 2007-12-18 11:47:07.000000000 +0100 -+++ perl-5.10.0/lib/Test/Simple/t/curr_test.t 2009-02-17 17:16:40.000000000 +0100 -@@ -1,4 +1,5 @@ - #!/usr/bin/perl -w -+# $Id$ - - # Dave Rolsky found a bug where if current_test() is used and no - # tests are run via Test::Builder it will blow up. ++++ perl-5.10.0/lib/Test/Simple/t/curr_test.t 1970-01-01 01:00:00.000000000 +0100 +@@ -1,11 +0,0 @@ +-#!/usr/bin/perl -w +- +-# Dave Rolsky found a bug where if current_test() is used and no +-# tests are run via Test::Builder it will blow up. +- +-use Test::Builder; +-$TB = Test::Builder->new; +-$TB->plan(tests => 2); +-print "ok 1\n"; +-print "ok 2\n"; +-$TB->current_test(2); diff -urN perl-5.10.0.orig/lib/Test/Simple/t/details.t perl-5.10.0/lib/Test/Simple/t/details.t --- perl-5.10.0.orig/lib/Test/Simple/t/details.t 2007-12-18 11:47:07.000000000 +0100 -+++ perl-5.10.0/lib/Test/Simple/t/details.t 2009-02-17 17:16:40.000000000 +0100 -@@ -1,4 +1,5 @@ - #!/usr/bin/perl -w -+# $Id$ - - BEGIN { - if( $ENV{PERL_CORE} ) { ++++ perl-5.10.0/lib/Test/Simple/t/details.t 2009-08-26 06:14:11.000000000 +0200 +@@ -29,13 +29,11 @@ + + # Inline TODO tests will confuse pre 1.20 Test::Harness, so we + # should just avoid the problem and not print it out. +-my $out_fh = $Test->output; +-my $todo_fh = $Test->todo_output; + my $start_test = $Test->current_test + 1; +-require TieOut; +-tie *FH, 'TieOut'; +-$Test->output(\*FH); +-$Test->todo_output(\*FH); ++ ++my $output = ''; ++$Test->output(\$output); ++$Test->todo_output(\$output); + + SKIP: { + $Test->skip( 'just testing skip' ); +@@ -68,8 +66,7 @@ + }; + + for ($start_test..$Test->current_test) { print "ok $_\n" } +-$Test->output($out_fh); +-$Test->todo_output($todo_fh); ++$Test->reset_outputs; + + $Test->is_num( scalar $Test->summary(), 4, 'summary' ); + push @Expected_Details, { 'ok' => 1, diff -urN perl-5.10.0.orig/lib/Test/Simple/t/diag.t perl-5.10.0/lib/Test/Simple/t/diag.t --- perl-5.10.0.orig/lib/Test/Simple/t/diag.t 2007-12-18 11:47:07.000000000 +0100 -+++ perl-5.10.0/lib/Test/Simple/t/diag.t 2009-02-17 17:16:40.000000000 +0100 -@@ -1,4 +1,5 @@ - #!perl -w -+# $Id$ - - BEGIN { - if( $ENV{PERL_CORE} ) { -@@ -24,49 +25,66 @@ ++++ perl-5.10.0/lib/Test/Simple/t/diag.t 2009-08-26 06:14:11.000000000 +0200 +@@ -24,49 +24,58 @@ use strict; -use Test::More tests => 5; ++use Test::Builder::NoOutput; +use Test::More tests => 7; -my $Test = Test::More->builder; -+my $test = Test::Builder->create; - - # now make a filehandle where we can send data - use TieOut; - my $output = tie *FAKEOUT, 'TieOut'; ++my $test = Test::Builder::NoOutput->create; +-# now make a filehandle where we can send data +-use TieOut; +-my $output = tie *FAKEOUT, 'TieOut'; +- -# force diagnostic output to a filehandle, glad I added this to -# Test::Builder :) -my $ret; --{ ++# Test diag() goes to todo_output() in a todo test. + { - local $TODO = 1; - $Test->todo_output(\*FAKEOUT); - - diag("a single line"); - +- - $ret = diag("multiple\n", "lines"); -} -+# Test diag() goes to todo_output() in a todo test. -+{ + $test->todo_start(); -+ $test->todo_output(\*FAKEOUT); -is( $output->read, <<'DIAG', 'diag() with todo_output set' ); + $test->diag("a single line"); -+ is( $output->read, <<'DIAG', 'diag() with todo_output set' ); ++ is( $test->read('todo'), <<'DIAG', 'diag() with todo_output set' ); # a single line +DIAG + + my $ret = $test->diag("multiple\n", "lines"); -+ is( $output->read, <<'DIAG', ' multi line' ); ++ is( $test->read('todo'), <<'DIAG', ' multi line' ); # multiple # lines DIAG @@ -4109,29 +4913,25 @@ diff -urN perl-5.10.0.orig/lib/Test/Simple/t/diag.t perl-5.10.0/lib/Test/Simple/ + + $test->todo_end(); +} -+ -+$test->reset_outputs(); -ok( !$ret, 'diag returns false' ); +# Test diagnostic formatting -+$test->failure_output(\*FAKEOUT); { - $Test->failure_output(\*FAKEOUT); - $ret = diag("# foo"); + $test->diag("# foo"); -+ is( $output->read, "# # foo\n", "diag() adds # even if there's one already" ); ++ is( $test->read('err'), "# # foo\n", "diag() adds # even if there's one already" ); + + $test->diag("foo\n\nbar"); -+ is( $output->read, <<'DIAG', " blank lines get escaped" ); ++ is( $test->read('err'), <<'DIAG', " blank lines get escaped" ); +# foo +# +# bar +DIAG + -+ + $test->diag("foo\n\nbar\n\n"); -+ is( $output->read, <<'DIAG', " even at the end" ); ++ is( $test->read('err'), <<'DIAG', " even at the end" ); +# foo +# +# bar @@ -4143,22 +4943,25 @@ diff -urN perl-5.10.0.orig/lib/Test/Simple/t/diag.t perl-5.10.0/lib/Test/Simple/ -ok( !$ret, 'diag returns false' ); - # [rt.cpan.org 8392] +-# [rt.cpan.org 8392] ++# [rt.cpan.org 8392] diag(@list) emulates print { - $Test->failure_output(\*FAKEOUT); - diag(qw(one two)); -+ $test->diag(qw(one two)); - } +-} -$Test->failure_output(\*STDERR); - is( $output->read, <<'DIAG' ); +-is( $output->read, <<'DIAG' ); ++ $test->diag(qw(one two)); ++ ++ is( $test->read('err'), <<'DIAG' ); # onetwo DIAG ++} diff -urN perl-5.10.0.orig/lib/Test/Simple/t/died.t perl-5.10.0/lib/Test/Simple/t/died.t --- perl-5.10.0.orig/lib/Test/Simple/t/died.t 1970-01-01 01:00:00.000000000 +0100 -+++ perl-5.10.0/lib/Test/Simple/t/died.t 2009-02-17 17:16:40.000000000 +0100 -@@ -0,0 +1,46 @@ ++++ perl-5.10.0/lib/Test/Simple/t/died.t 2009-08-26 06:14:11.000000000 +0200 +@@ -0,0 +1,45 @@ +#!perl -w -+# $Id$ + +BEGIN { + if( $ENV{PERL_CORE} ) { @@ -4203,12 +5006,171 @@ diff -urN perl-5.10.0.orig/lib/Test/Simple/t/died.t perl-5.10.0/lib/Test/Simple/ + + exit grep { !$_ } $TB->summary; +} +diff -urN perl-5.10.0.orig/lib/Test/Simple/t/done_testing_double.t perl-5.10.0/lib/Test/Simple/t/done_testing_double.t +--- perl-5.10.0.orig/lib/Test/Simple/t/done_testing_double.t 1970-01-01 01:00:00.000000000 +0100 ++++ perl-5.10.0/lib/Test/Simple/t/done_testing_double.t 2009-08-26 06:14:40.000000000 +0200 +@@ -0,0 +1,46 @@ ++#!/usr/bin/perl -w ++ ++BEGIN { ++ if( $ENV{PERL_CORE} ) { ++ chdir 't'; ++ @INC = qw(../lib lib ../lib/Test/Simple/t/lib); ++ } ++} ++ ++use strict; ++use lib 't/lib'; ++ ++use Test::Builder; ++use Test::Builder::NoOutput; ++ ++my $tb = Test::Builder::NoOutput->create; ++ ++{ ++ # Normalize test output ++ local $ENV{HARNESS_ACTIVE}; ++ ++ $tb->ok(1); ++ $tb->ok(1); ++ $tb->ok(1); ++ ++#line 24 ++ $tb->done_testing(3); ++ $tb->done_testing; ++ $tb->done_testing; ++} ++ ++my $Test = Test::Builder->new; ++$Test->plan( tests => 1 ); ++$Test->level(0); ++$Test->is_eq($tb->read, <<"END", "multiple done_testing"); ++ok 1 ++ok 2 ++ok 3 ++1..3 ++not ok 4 - done_testing() was already called at $0 line 24 ++# Failed test 'done_testing() was already called at $0 line 24' ++# at $0 line 25. ++not ok 5 - done_testing() was already called at $0 line 24 ++# Failed test 'done_testing() was already called at $0 line 24' ++# at $0 line 26. ++END +diff -urN perl-5.10.0.orig/lib/Test/Simple/t/done_testing_plan_mismatch.t perl-5.10.0/lib/Test/Simple/t/done_testing_plan_mismatch.t +--- perl-5.10.0.orig/lib/Test/Simple/t/done_testing_plan_mismatch.t 1970-01-01 01:00:00.000000000 +0100 ++++ perl-5.10.0/lib/Test/Simple/t/done_testing_plan_mismatch.t 2009-08-26 06:14:43.000000000 +0200 +@@ -0,0 +1,44 @@ ++#!/usr/bin/perl -w ++ ++BEGIN { ++ if( $ENV{PERL_CORE} ) { ++ chdir 't'; ++ @INC = qw(../lib lib ../lib/Test/Simple/t/lib); ++ } ++} ++ ++# What if there's a plan and done_testing but they don't match? ++ ++use strict; ++use lib 't/lib'; ++ ++use Test::Builder; ++use Test::Builder::NoOutput; ++ ++my $tb = Test::Builder::NoOutput->create; ++ ++{ ++ # Normalize test output ++ local $ENV{HARNESS_ACTIVE}; ++ ++ $tb->plan( tests => 3 ); ++ $tb->ok(1); ++ $tb->ok(1); ++ $tb->ok(1); ++ ++#line 24 ++ $tb->done_testing(2); ++} ++ ++my $Test = Test::Builder->new; ++$Test->plan( tests => 1 ); ++$Test->level(0); ++$Test->is_eq($tb->read, <<"END"); ++1..3 ++ok 1 ++ok 2 ++ok 3 ++not ok 4 - planned to run 3 but done_testing() expects 2 ++# Failed test 'planned to run 3 but done_testing() expects 2' ++# at $0 line 24. ++END +diff -urN perl-5.10.0.orig/lib/Test/Simple/t/done_testing.t perl-5.10.0/lib/Test/Simple/t/done_testing.t +--- perl-5.10.0.orig/lib/Test/Simple/t/done_testing.t 1970-01-01 01:00:00.000000000 +0100 ++++ perl-5.10.0/lib/Test/Simple/t/done_testing.t 2009-08-26 06:14:11.000000000 +0200 +@@ -0,0 +1,12 @@ ++#!/usr/bin/perl -w ++ ++use strict; ++ ++use Test::Builder; ++ ++my $tb = Test::Builder->new; ++$tb->level(0); ++ ++$tb->ok(1, "testing done_testing() with no arguments"); ++$tb->ok(1, " another test so we're not testing just one"); ++$tb->done_testing(); +diff -urN perl-5.10.0.orig/lib/Test/Simple/t/done_testing_with_no_plan.t perl-5.10.0/lib/Test/Simple/t/done_testing_with_no_plan.t +--- perl-5.10.0.orig/lib/Test/Simple/t/done_testing_with_no_plan.t 1970-01-01 01:00:00.000000000 +0100 ++++ perl-5.10.0/lib/Test/Simple/t/done_testing_with_no_plan.t 2009-08-26 06:14:11.000000000 +0200 +@@ -0,0 +1,11 @@ ++#!/usr/bin/perl -w ++ ++use strict; ++ ++use Test::Builder; ++ ++my $tb = Test::Builder->new; ++$tb->plan( "no_plan" ); ++$tb->ok(1); ++$tb->ok(1); ++$tb->done_testing(2); +diff -urN perl-5.10.0.orig/lib/Test/Simple/t/done_testing_with_number.t perl-5.10.0/lib/Test/Simple/t/done_testing_with_number.t +--- perl-5.10.0.orig/lib/Test/Simple/t/done_testing_with_number.t 1970-01-01 01:00:00.000000000 +0100 ++++ perl-5.10.0/lib/Test/Simple/t/done_testing_with_number.t 2009-08-26 06:14:11.000000000 +0200 +@@ -0,0 +1,12 @@ ++#!/usr/bin/perl -w ++ ++use strict; ++ ++use Test::Builder; ++ ++my $tb = Test::Builder->new; ++$tb->level(0); ++ ++$tb->ok(1, "testing done_testing() with no arguments"); ++$tb->ok(1, " another test so we're not testing just one"); ++$tb->done_testing(2); +diff -urN perl-5.10.0.orig/lib/Test/Simple/t/done_testing_with_plan.t perl-5.10.0/lib/Test/Simple/t/done_testing_with_plan.t +--- perl-5.10.0.orig/lib/Test/Simple/t/done_testing_with_plan.t 1970-01-01 01:00:00.000000000 +0100 ++++ perl-5.10.0/lib/Test/Simple/t/done_testing_with_plan.t 2009-08-26 06:14:11.000000000 +0200 +@@ -0,0 +1,11 @@ ++#!/usr/bin/perl -w ++ ++use strict; ++ ++use Test::Builder; ++ ++my $tb = Test::Builder->new; ++$tb->plan( tests => 2 ); ++$tb->ok(1); ++$tb->ok(1); ++$tb->done_testing(2); diff -urN perl-5.10.0.orig/lib/Test/Simple/t/dont_overwrite_die_handler.t perl-5.10.0/lib/Test/Simple/t/dont_overwrite_die_handler.t --- perl-5.10.0.orig/lib/Test/Simple/t/dont_overwrite_die_handler.t 1970-01-01 01:00:00.000000000 +0100 -+++ perl-5.10.0/lib/Test/Simple/t/dont_overwrite_die_handler.t 2009-02-17 17:16:40.000000000 +0100 -@@ -0,0 +1,20 @@ ++++ perl-5.10.0/lib/Test/Simple/t/dont_overwrite_die_handler.t 2009-08-26 06:14:11.000000000 +0200 +@@ -0,0 +1,19 @@ +#!/usr/bin/perl -w -+# $Id$ + +BEGIN { + if( $ENV{PERL_CORE} ) { @@ -4227,28 +5189,28 @@ diff -urN perl-5.10.0.orig/lib/Test/Simple/t/dont_overwrite_die_handler.t perl-5 + +ok !eval { die }; +is $handler_called, 1, 'existing DIE handler not overridden'; -diff -urN perl-5.10.0.orig/lib/Test/Simple/t/eq_set.t perl-5.10.0/lib/Test/Simple/t/eq_set.t ---- perl-5.10.0.orig/lib/Test/Simple/t/eq_set.t 2007-12-18 11:47:07.000000000 +0100 -+++ perl-5.10.0/lib/Test/Simple/t/eq_set.t 2009-02-17 17:16:40.000000000 +0100 -@@ -1,4 +1,5 @@ - #!perl -w -+# $Id$ - - BEGIN { - if( $ENV{PERL_CORE} ) { diff -urN perl-5.10.0.orig/lib/Test/Simple/t/exit.t perl-5.10.0/lib/Test/Simple/t/exit.t --- perl-5.10.0.orig/lib/Test/Simple/t/exit.t 2007-12-18 11:47:07.000000000 +0100 -+++ perl-5.10.0/lib/Test/Simple/t/exit.t 2009-02-17 17:16:40.000000000 +0100 -@@ -1,4 +1,5 @@ - #!/usr/bin/perl -w -+# $Id$ - - # Can't use Test.pm, that's a 5.005 thing. - package My::Test; -@@ -25,18 +26,9 @@ - exit 0; ++++ perl-5.10.0/lib/Test/Simple/t/exit.t 2009-08-26 06:14:11.000000000 +0200 +@@ -10,59 +10,27 @@ + } } +-unless( eval { require File::Spec } ) { +- print "1..0 # Skip Need File::Spec to run this test\n"; +- exit 0; +-} +- +-if( $^O eq 'VMS' && $] <= 5.00503 ) { +- print "1..0 # Skip test will hang on older VMS perls\n"; +- exit 0; +-} +- +-if( $^O eq 'MacOS' ) { +- print "1..0 # Skip exit status broken on Mac OS\n"; +- exit 0; +-} +- -my $test_num = 1; -# Utility testing functions. -sub ok ($;$) { @@ -4267,57 +5229,140 @@ diff -urN perl-5.10.0.orig/lib/Test/Simple/t/exit.t perl-5.10.0/lib/Test/Simple/ package main; -@@ -59,10 +51,11 @@ - 'pre_plan_death.plx' => ['not zero', 'not zero'], - 'death_in_eval.plx' => [0, 0], - 'require.plx' => [0, 0], + +-my $IsVMS = $^O eq 'VMS'; ++use Cwd; ++use File::Spec; + +-print "# Ahh! I see you're running VMS.\n" if $IsVMS; ++my $Orig_Dir = cwd; + +-my %Tests = ( +- # Everyone Else VMS +- 'success.plx' => [0, 0], +- 'one_fail.plx' => [1, 4], +- 'two_fail.plx' => [2, 4], +- 'five_fail.plx' => [5, 4], +- 'extras.plx' => [2, 4], +- 'too_few.plx' => [255, 4], +- 'too_few_fail.plx' => [2, 4], +- 'death.plx' => [255, 4], +- 'last_minute_death.plx' => [255, 4], +- 'pre_plan_death.plx' => ['not zero', 'not zero'], +- 'death_in_eval.plx' => [0, 0], +- 'require.plx' => [0, 0], - 'exit.plx' => [1, 4], -+ 'death_with_handler.plx' => [255, 4], -+ 'exit.plx' => [1, 4], - ); +- ); ++my $Perl = File::Spec->rel2abs($^X); ++if( $^O eq 'VMS' ) { ++ # VMS can't use its own $^X in a system call until almost 5.8 ++ $Perl = "MCR $^X" if $] < 5.007003; ++ ++ # Quiet noisy 'SYS$ABORT' ++ $Perl .= q{ -"Mvmsish=hushed"}; ++} -print "1..".keys(%Tests)."\n"; -+$TB->plan( tests => scalar keys(%Tests) ); eval { require POSIX; &POSIX::WEXITSTATUS(0) }; if( $@ ) { -@@ -72,13 +65,13 @@ +@@ -72,34 +40,74 @@ *exitstatus = sub { POSIX::WEXITSTATUS($_[0]) } } -+my $Perl = File::Spec->rel2abs($^X); -+ - chdir 't'; - my $lib = File::Spec->catdir(qw(lib Test Simple sample_tests)); - while( my($test_name, $exit_codes) = each %Tests ) { - my($exit_code) = $exit_codes->[$IsVMS ? 1 : 0]; +-chdir 't'; +-my $lib = File::Spec->catdir(qw(lib Test Simple sample_tests)); +-while( my($test_name, $exit_codes) = each %Tests ) { +- my($exit_code) = $exit_codes->[$IsVMS ? 1 : 0]; - my $Perl = $^X; ++# Some OS' will alter the exit code to their own native sense... ++# sometimes. Rather than deal with the exception we'll just ++# build up the mapping. ++print "# Building up a map of exit codes. May take a while.\n"; ++my %Exit_Map; ++ ++open my $fh, ">", "exit_map_test" or die $!; ++print $fh <<'DONE'; ++if ($^O eq 'VMS') { ++ require vmsish; ++ import vmsish qw(hushed); ++} ++my $exit = shift; ++print "exit $exit\n"; ++END { $? = $exit }; ++DONE ++ ++close $fh; ++END { 1 while unlink "exit_map_test" } ++ ++for my $exit (0..255) { ++ # This correctly emulates Test::Builder's behavior. ++ my $out = qx[$Perl exit_map_test $exit]; ++ $TB->like( $out, qr/^exit $exit\n/, "exit map test for $exit" ); ++ $Exit_Map{$exit} = exitstatus($?); ++} ++print "# Done.\n"; ++ + +- if( $^O eq 'VMS' ) { +- # VMS can't use its own $^X in a system call until almost 5.8 +- $Perl = "MCR $^X" if $] < 5.007003; - - if( $^O eq 'VMS' ) { - # VMS can't use its own $^X in a system call until almost 5.8 - $Perl = "MCR $^X" if $] < 5.007003; -@@ -93,12 +86,12 @@ +- # Quiet noisy 'SYS$ABORT'. 'hushed' only exists in 5.6 and up, +- # but it doesn't do any harm on eariler perls. +- $Perl .= q{ -"Mvmsish=hushed"}; +- } ++my %Tests = ( ++ # File Exit Code ++ 'success.plx' => 0, ++ 'one_fail.plx' => 1, ++ 'two_fail.plx' => 2, ++ 'five_fail.plx' => 5, ++ 'extras.plx' => 2, ++ 'too_few.plx' => 255, ++ 'too_few_fail.plx' => 2, ++ 'death.plx' => 255, ++ 'last_minute_death.plx' => 255, ++ 'pre_plan_death.plx' => 'not zero', ++ 'death_in_eval.plx' => 0, ++ 'require.plx' => 0, ++ 'death_with_handler.plx' => 255, ++ 'exit.plx' => 1, ++ ); + ++chdir 't'; ++my $lib = File::Spec->catdir(qw(lib Test Simple sample_tests)); ++while( my($test_name, $exit_code) = each %Tests ) { + my $file = File::Spec->catfile($lib, $test_name); + my $wait_stat = system(qq{$Perl -"I../blib/lib" -"I../lib" -"I../t/lib" $file}); my $actual_exit = exitstatus($wait_stat); if( $exit_code eq 'not zero' ) { - My::Test::ok( $actual_exit != 0, -+ $TB->isnt_num( $actual_exit, 0, ++ $TB->isnt_num( $actual_exit, $Exit_Map{0}, "$test_name exited with $actual_exit ". - "(expected $exit_code)"); +- "(expected $exit_code)"); ++ "(expected non-zero)"); } else { - My::Test::ok( $actual_exit == $exit_code, -+ $TB->is_num( $actual_exit, $exit_code, ++ $TB->is_num( $actual_exit, $Exit_Map{$exit_code}, "$test_name exited with $actual_exit ". - "(expected $exit_code)"); +- "(expected $exit_code)"); ++ "(expected $Exit_Map{$exit_code})"); } + } ++ ++$TB->done_testing( scalar keys(%Tests) + 256 ); ++ ++# So any END block file cleanup works. ++chdir $Orig_Dir; diff -urN perl-5.10.0.orig/lib/Test/Simple/t/explain.t perl-5.10.0/lib/Test/Simple/t/explain.t --- perl-5.10.0.orig/lib/Test/Simple/t/explain.t 1970-01-01 01:00:00.000000000 +0100 -+++ perl-5.10.0/lib/Test/Simple/t/explain.t 2009-02-17 17:16:40.000000000 +0100 -@@ -0,0 +1,28 @@ ++++ perl-5.10.0/lib/Test/Simple/t/explain.t 2009-08-26 06:14:11.000000000 +0200 +@@ -0,0 +1,27 @@ +#!/usr/bin/perl -w -+# $Id$ + +BEGIN { + if( $ENV{PERL_CORE} ) { @@ -4344,34 +5389,10 @@ diff -urN perl-5.10.0.orig/lib/Test/Simple/t/explain.t perl-5.10.0/lib/Test/Simp +is_deeply [map { eval $_ } explain([], {})], [[], {}]; + +is_deeply [map { eval $_ } explain(23, [42,91], 99)], [23, [42, 91], 99]; -diff -urN perl-5.10.0.orig/lib/Test/Simple/t/extra.t perl-5.10.0/lib/Test/Simple/t/extra.t ---- perl-5.10.0.orig/lib/Test/Simple/t/extra.t 2007-12-18 11:47:07.000000000 +0100 -+++ perl-5.10.0/lib/Test/Simple/t/extra.t 2009-02-17 17:16:40.000000000 +0100 -@@ -1,4 +1,5 @@ - #!perl -w -+# $Id$ - - BEGIN { - if( $ENV{PERL_CORE} ) { -@@ -51,7 +52,7 @@ - # at $0 line 31. - # Failed test 'Sar' - # at $0 line 34. --# Looks like you planned 3 tests but ran 2 extra. -+# Looks like you planned 3 tests but ran 5. - # Looks like you failed 2 tests of 5 run. - ERR - diff -urN perl-5.10.0.orig/lib/Test/Simple/t/extra_one.t perl-5.10.0/lib/Test/Simple/t/extra_one.t --- perl-5.10.0.orig/lib/Test/Simple/t/extra_one.t 2007-12-18 11:47:07.000000000 +0100 -+++ perl-5.10.0/lib/Test/Simple/t/extra_one.t 2009-02-17 17:16:40.000000000 +0100 -@@ -1,4 +1,5 @@ - #!/usr/bin/perl -w -+# $Id$ - - BEGIN { - if( $ENV{PERL_CORE} ) { -@@ -44,7 +45,7 @@ ++++ perl-5.10.0/lib/Test/Simple/t/extra_one.t 2009-08-26 06:14:11.000000000 +0200 +@@ -44,7 +44,7 @@ OUT My::Test::is($$err, <create; @@ -4406,7 +5438,7 @@ diff -urN perl-5.10.0.orig/lib/Test/Simple/t/fail-like.t perl-5.10.0/lib/Test/Si require Test::Simple::Catch; -@@ -43,11 +37,10 @@ +@@ -43,11 +36,10 @@ require Test::More; Test::More->import(tests => 1); @@ -4421,7 +5453,7 @@ diff -urN perl-5.10.0.orig/lib/Test/Simple/t/fail-like.t perl-5.10.0/lib/Test/Si 1..1 not ok 1 - is foo like that OUT -@@ -57,11 +50,26 @@ +@@ -57,11 +49,26 @@ # at .* line 1\. # 'foo' # doesn't match '\\(\\?-xism:that\\)' @@ -4433,7 +5465,7 @@ diff -urN perl-5.10.0.orig/lib/Test/Simple/t/fail-like.t perl-5.10.0/lib/Test/Si - $TB->like($$err, qr/^$err_re$/, 'failing errors'); +{ -+ # line 60 ++ # line 59 + like("foo", "not a regex"); + $TB->is_eq($out->read, <is_eq($err->read, <create; -$TB->plan(tests => 17); -+$TB->plan(tests => 23); ++$TB->plan(tests => 78); sub like ($$;$) { $TB->like(@_); -@@ -41,11 +42,18 @@ - return $TB->is_eq( $got, $expect ); +@@ -34,19 +34,26 @@ + $TB->is_eq(@_); } -+sub main::err_like ($) { -+ my($expect) = @_; -+ my $got = $err->read; -+ -+ return $TB->like( $got, qr/$expect/ ); +-sub main::err_ok ($) { +- my($expect) = @_; +- my $got = $err->read; ++sub main::out_ok ($$) { ++ $TB->is_eq( $out->read, shift ); ++ $TB->is_eq( $err->read, shift ); +} + ++sub main::out_like ($$) { ++ my($output, $failure) = @_; + +- return $TB->is_eq( $got, $expect ); ++ $TB->like( $out->read, qr/$output/ ); ++ $TB->like( $err->read, qr/$failure/ ); + } + package main; require Test::More; -my $Total = 30; -+my $Total = 36; ++our $TODO; ++my $Total = 37; Test::More->import(tests => $Total); ++$out->read; # clear the plan from $out # This should all work in the presence of a __DIE__ handler. -@@ -96,19 +104,16 @@ - err_ok( <ok(0, "DIE handler called: ".join "", @_); }; +@@ -57,184 +64,387 @@ + + my $Filename = quotemeta $0; + +-# Preserve the line numbers. ++ + #line 38 + ok( 0, 'failing' ); +-err_ok( <can(...) ++OUT + # Failed test 'Mooble::Hooble::Yooble->can(...)' +-# at $0 line 52. ++# at $0 line 197. + # Mooble::Hooble::Yooble->can('this') failed + # Mooble::Hooble::Yooble->can('that') failed ++ERR ++ ++#line 208 ++can_ok('Mooble::Hooble::Yooble', ()); ++out_ok( <can(...) ++OUT + # Failed test 'Mooble::Hooble::Yooble->can(...)' +-# at $0 line 53. ++# at $0 line 208. + # can_ok() called with no methods ++ERR ++ ++#line 218 ++can_ok(undef, undef); ++out_ok( <can(...) ++OUT + # Failed test '->can(...)' +-# at $0 line 54. ++# at $0 line 218. + # can_ok() called with empty class or reference ++ERR ++ ++#line 228 ++can_ok([], "foo"); ++out_ok( <can('foo') ++OUT + # Failed test 'ARRAY->can('foo')' +-# at $0 line 55. ++# at $0 line 228. + # ARRAY->can('foo') failed + ERR + +-#line 55 ++#line 238 + isa_ok(bless([], "Foo"), "Wibble"); +-isa_ok(42, "Wibble", "My Wibble"); +-isa_ok(undef, "Wibble", "Another Wibble"); +-isa_ok([], "HASH"); +-err_ok( <is_eq( $out->read, <is_eq( $err->read, <read, "/^$more_err_re/"); +- +- +-#line 85 ++#line 460 + require_ok('ALL::YOUR::BASE::ARE::BELONG::TO::US::wibble'); + $more_err_re = <read, "/^$more_err_re/"); ++out_like( ++ qr/^\Qnot ok - require ALL::YOUR::BASE::ARE::BELONG::TO::US::wibble;\E\n\z/, ++ qr/^$more_err_re/ ++); + + +-#line 88 + END { +- $TB->is_eq($$out, <can(...) +-not ok - Mooble::Hooble::Yooble->can(...) +-not ok - ->can(...) +-not ok - ARRAY->can('foo') +-not ok - The object isa Wibble +-not ok - My Wibble isa Wibble +-not ok - Another Wibble isa Wibble +-not ok - The object isa HASH +-not ok - cmp_ok eq +-not ok - == +-not ok - != +-not ok - && +-not ok - eq with numbers +-not ok - == with strings +-not ok - eq with stringified errno +-not ok - eq with numerified errno +-not ok - use Hooble::mooble::yooble; +-not ok - require ALL::YOUR::BASE::ARE::BELONG::TO::US::wibble; ++ out_like( <new; + +-print "1..2\n"; ++{ ++ my $tb = Test::Builder::NoOutput->create; + +-my $test_num = 1; +-# Utility testing functions. +-sub ok ($;$) { +- my($test, $name) = @_; +- my $ok = ''; +- $ok .= "not " unless $test; +- $ok .= "ok $test_num"; +- $ok .= " - $name" if defined $name; +- $ok .= "\n"; +- print $ok; +- $test_num++; ++ $tb->plan( tests => 1 ); + +- return $test ? 1 : 0; +-} +- +- +-package main; +- +-require Test::Simple; +-Test::Simple->import(tests => 1); +- +-#line 45 +-ok(0); ++#line 28 ++ $tb->ok(0); ++ $tb->_ending; + +-END { +- My::Test::ok($$out eq <is_eq($tb->read('out'), <is_eq($tb->read('err'), <done_testing(2); + } diff -urN perl-5.10.0.orig/lib/Test/Simple/t/fail.t perl-5.10.0/lib/Test/Simple/t/fail.t --- perl-5.10.0.orig/lib/Test/Simple/t/fail.t 2007-12-18 11:47:07.000000000 +0100 -+++ perl-5.10.0/lib/Test/Simple/t/fail.t 2009-02-17 17:16:40.000000000 +0100 -@@ -1,4 +1,5 @@ ++++ perl-5.10.0/lib/Test/Simple/t/fail.t 2009-08-26 06:14:11.000000000 +0200 +@@ -1,5 +1,7 @@ #!perl -w -+# $Id$ ++# Simple test of what failure output looks like ++ BEGIN { if( $ENV{PERL_CORE} ) { -diff -urN perl-5.10.0.orig/lib/Test/Simple/t/fail_one.t perl-5.10.0/lib/Test/Simple/t/fail_one.t ---- perl-5.10.0.orig/lib/Test/Simple/t/fail_one.t 2007-12-18 11:47:07.000000000 +0100 -+++ perl-5.10.0/lib/Test/Simple/t/fail_one.t 2009-02-17 17:16:40.000000000 +0100 -@@ -1,4 +1,5 @@ - #!/usr/bin/perl -w -+# $Id$ + chdir 't'; +@@ -12,45 +14,28 @@ - BEGIN { - if( $ENV{PERL_CORE} ) { + use strict; + +-require Test::Simple::Catch; +-my($out, $err) = Test::Simple::Catch::caught(); ++# Normalize the output whether we're running under Test::Harness or not. + local $ENV{HARNESS_ACTIVE} = 0; + ++use Test::Builder; ++use Test::Builder::NoOutput; + +-# Can't use Test.pm, that's a 5.005 thing. +-package My::Test; +- +-print "1..2\n"; +- +-my $test_num = 1; +-# Utility testing functions. +-sub ok ($;$) { +- my($test, $name) = @_; +- my $ok = ''; +- $ok .= "not " unless $test; +- $ok .= "ok $test_num"; +- $ok .= " - $name" if defined $name; +- $ok .= "\n"; +- print $ok; +- $test_num++; +-} +- +- +-package main; +- +-require Test::Simple; +-Test::Simple->import(tests => 5); +- +-#line 35 +-ok( 1, 'passing' ); +-ok( 2, 'passing still' ); +-ok( 3, 'still passing' ); +-ok( 0, 'oh no!' ); +-ok( 0, 'damnit' ); ++my $Test = Test::Builder->new; + ++# Set up a builder to record some failing tests. ++{ ++ my $tb = Test::Builder::NoOutput->create; ++ $tb->plan( tests => 5 ); ++ ++#line 28 ++ $tb->ok( 1, 'passing' ); ++ $tb->ok( 2, 'passing still' ); ++ $tb->ok( 3, 'still passing' ); ++ $tb->ok( 0, 'oh no!' ); ++ $tb->ok( 0, 'damnit' ); ++ $tb->_ending; + +-END { +- My::Test::ok($$out eq <is_eq($tb->read('out'), <is_eq($tb->read('err'), <done_testing(2); + } diff -urN perl-5.10.0.orig/lib/Test/Simple/t/filehandles.t perl-5.10.0/lib/Test/Simple/t/filehandles.t --- perl-5.10.0.orig/lib/Test/Simple/t/filehandles.t 2007-12-18 11:47:07.000000000 +0100 -+++ perl-5.10.0/lib/Test/Simple/t/filehandles.t 2009-02-17 17:16:40.000000000 +0100 -@@ -1,21 +1,19 @@ - #!perl -w -+# $Id$ - ++++ perl-5.10.0/lib/Test/Simple/t/filehandles.t 2009-08-26 06:14:11.000000000 +0200 +@@ -3,19 +3,16 @@ BEGIN { if( $ENV{PERL_CORE} ) { chdir 't'; @@ -4654,63 +6289,71 @@ diff -urN perl-5.10.0.orig/lib/Test/Simple/t/filehandles.t perl-5.10.0/lib/Test/ - -package Dev::Null; -- --sub TIEHANDLE { bless {} } --sub PRINT { 1 } -diff -urN perl-5.10.0.orig/lib/Test/Simple/t/fork.t perl-5.10.0/lib/Test/Simple/t/fork.t ---- perl-5.10.0.orig/lib/Test/Simple/t/fork.t 2007-12-18 11:47:07.000000000 +0100 -+++ perl-5.10.0/lib/Test/Simple/t/fork.t 2009-02-17 17:16:40.000000000 +0100 -@@ -1,4 +1,5 @@ - #!/usr/bin/perl -w -+# $Id$ - - BEGIN { - if( $ENV{PERL_CORE} ) { -diff -urN perl-5.10.0.orig/lib/Test/Simple/t/harness_active.t perl-5.10.0/lib/Test/Simple/t/harness_active.t ---- perl-5.10.0.orig/lib/Test/Simple/t/harness_active.t 2007-12-18 11:47:07.000000000 +0100 -+++ perl-5.10.0/lib/Test/Simple/t/harness_active.t 2009-02-17 17:16:40.000000000 +0100 -@@ -1,4 +1,5 @@ - #!perl -w -+# $Id$ - - BEGIN { - if( $ENV{PERL_CORE} ) { -diff -urN perl-5.10.0.orig/lib/Test/Simple/t/has_plan.t perl-5.10.0/lib/Test/Simple/t/has_plan.t ---- perl-5.10.0.orig/lib/Test/Simple/t/has_plan.t 2007-12-18 11:47:07.000000000 +0100 -+++ perl-5.10.0/lib/Test/Simple/t/has_plan.t 2009-02-17 17:16:40.000000000 +0100 -@@ -1,4 +1,5 @@ - #!/usr/bin/perl -w -+# $Id$ - - BEGIN { - if( $ENV{PERL_CORE} ) { -diff -urN perl-5.10.0.orig/lib/Test/Simple/t/has_plan2.t perl-5.10.0/lib/Test/Simple/t/has_plan2.t ---- perl-5.10.0.orig/lib/Test/Simple/t/has_plan2.t 2007-12-18 11:47:07.000000000 +0100 -+++ perl-5.10.0/lib/Test/Simple/t/has_plan2.t 2009-02-17 17:16:40.000000000 +0100 -@@ -1,4 +1,5 @@ - #!/usr/bin/perl -w -+# $Id$ - - BEGIN { - if( $ENV{PERL_CORE} ) { -diff -urN perl-5.10.0.orig/lib/Test/Simple/t/import.t perl-5.10.0/lib/Test/Simple/t/import.t ---- perl-5.10.0.orig/lib/Test/Simple/t/import.t 2007-12-18 11:47:07.000000000 +0100 -+++ perl-5.10.0/lib/Test/Simple/t/import.t 2009-02-17 17:16:40.000000000 +0100 -@@ -1,3 +1,4 @@ -+# $Id$ - BEGIN { - if( $ENV{PERL_CORE} ) { - chdir 't'; +- +-sub TIEHANDLE { bless {} } +-sub PRINT { 1 } +diff -urN perl-5.10.0.orig/lib/Test/Simple/t/fork_with_new_stdout.t perl-5.10.0/lib/Test/Simple/t/fork_with_new_stdout.t +--- perl-5.10.0.orig/lib/Test/Simple/t/fork_with_new_stdout.t 1970-01-01 01:00:00.000000000 +0100 ++++ perl-5.10.0/lib/Test/Simple/t/fork_with_new_stdout.t 2009-08-26 06:14:11.000000000 +0200 +@@ -0,0 +1,54 @@ ++#!perl -w ++use strict; ++use warnings; ++use IO::Pipe; ++use Test::Builder; ++use Config; ++ ++my $b = Test::Builder->new; ++$b->reset; ++ ++my $Can_Fork = $Config{d_fork} || ++ (($^O eq 'MSWin32' || $^O eq 'NetWare') and ++ $Config{useithreads} and ++ $Config{ccflags} =~ /-DPERL_IMPLICIT_SYS/ ++ ); ++ ++if( !$Can_Fork ) { ++ $b->plan('skip_all' => "This system cannot fork"); ++} ++else { ++ $b->plan('tests' => 2); ++} ++ ++my $pipe = IO::Pipe->new; ++if ( my $pid = fork ) { ++ $pipe->reader; ++ $b->ok((<$pipe> =~ /FROM CHILD: ok 1/), "ok 1 from child"); ++ $b->ok((<$pipe> =~ /FROM CHILD: 1\.\.1/), "1..1 from child"); ++ waitpid($pid, 0); ++} ++else { ++ $pipe->writer; ++ my $pipe_fd = $pipe->fileno; ++ close STDOUT; ++ open(STDOUT, ">&$pipe_fd"); ++ my $b = Test::Builder->new; ++ $b->reset; ++ $b->no_plan; ++ $b->ok(1); ++} ++ ++ ++=pod ++#actual ++1..2 ++ok 1 ++1..1 ++ok 1 ++ok 2 ++#expected ++1..2 ++ok 1 ++ok 2 ++=cut diff -urN perl-5.10.0.orig/lib/Test/Simple/t/is_deeply_dne_bug.t perl-5.10.0/lib/Test/Simple/t/is_deeply_dne_bug.t --- perl-5.10.0.orig/lib/Test/Simple/t/is_deeply_dne_bug.t 2007-12-18 11:47:07.000000000 +0100 -+++ perl-5.10.0/lib/Test/Simple/t/is_deeply_dne_bug.t 2009-02-17 17:16:40.000000000 +0100 -@@ -1,4 +1,5 @@ - #!/usr/bin/perl -w -+# $Id$ - - # test for rt.cpan.org 20768 - # -@@ -16,16 +17,7 @@ ++++ perl-5.10.0/lib/Test/Simple/t/is_deeply_dne_bug.t 2009-08-26 06:14:11.000000000 +0200 +@@ -16,16 +16,7 @@ } use strict; @@ -4730,14 +6373,8 @@ diff -urN perl-5.10.0.orig/lib/Test/Simple/t/is_deeply_dne_bug.t perl-5.10.0/lib package Foo; diff -urN perl-5.10.0.orig/lib/Test/Simple/t/is_deeply_fail.t perl-5.10.0/lib/Test/Simple/t/is_deeply_fail.t --- perl-5.10.0.orig/lib/Test/Simple/t/is_deeply_fail.t 2007-12-18 11:47:07.000000000 +0100 -+++ perl-5.10.0/lib/Test/Simple/t/is_deeply_fail.t 2009-02-17 17:16:40.000000000 +0100 -@@ -1,4 +1,5 @@ - #!/usr/bin/perl -w -+# $Id$ - - BEGIN { - if( $ENV{PERL_CORE} ) { -@@ -317,7 +318,8 @@ ++++ perl-5.10.0/lib/Test/Simple/t/is_deeply_fail.t 2009-08-26 06:14:11.000000000 +0200 +@@ -317,7 +317,8 @@ ERR @@ -4747,7 +6384,7 @@ diff -urN perl-5.10.0.orig/lib/Test/Simple/t/is_deeply_fail.t perl-5.10.0/lib/Te my $foo = bless [], "Foo"; my $bar = bless {}, "Bar"; -@@ -337,9 +339,6 @@ +@@ -337,9 +338,6 @@ ERR } @@ -4759,14 +6396,8 @@ diff -urN perl-5.10.0.orig/lib/Test/Simple/t/is_deeply_fail.t perl-5.10.0/lib/Te diff -urN perl-5.10.0.orig/lib/Test/Simple/t/is_deeply_with_threads.t perl-5.10.0/lib/Test/Simple/t/is_deeply_with_threads.t --- perl-5.10.0.orig/lib/Test/Simple/t/is_deeply_with_threads.t 2007-12-18 11:47:07.000000000 +0100 -+++ perl-5.10.0/lib/Test/Simple/t/is_deeply_with_threads.t 2009-02-17 17:16:40.000000000 +0100 -@@ -1,4 +1,5 @@ - #!/usr/bin/perl -w -+# $Id$ - - # Test to see if is_deeply() plays well with threads. - -@@ -19,7 +20,12 @@ ++++ perl-5.10.0/lib/Test/Simple/t/is_deeply_with_threads.t 2009-08-26 06:14:11.000000000 +0200 +@@ -19,7 +19,12 @@ unless ( $] >= 5.008001 && $Config{'useithreads'} && eval { require threads; 'threads'->import; 1; }) { @@ -4780,7 +6411,7 @@ diff -urN perl-5.10.0.orig/lib/Test/Simple/t/is_deeply_with_threads.t perl-5.10. exit 0; } } -@@ -27,7 +33,7 @@ +@@ -27,7 +32,7 @@ my $Num_Threads = 5; @@ -4789,50 +6420,45 @@ diff -urN perl-5.10.0.orig/lib/Test/Simple/t/is_deeply_with_threads.t perl-5.10. sub do_one_thread { -@@ -56,3 +62,5 @@ +@@ -56,3 +61,5 @@ my $rc = $t->join(); cmp_ok( $rc, '==', 42, "threads exit status is $rc" ); } + +pass("End of test"); -diff -urN perl-5.10.0.orig/lib/Test/Simple/t/is_fh.t perl-5.10.0/lib/Test/Simple/t/is_fh.t ---- perl-5.10.0.orig/lib/Test/Simple/t/is_fh.t 2007-12-18 11:47:07.000000000 +0100 -+++ perl-5.10.0/lib/Test/Simple/t/is_fh.t 2009-02-17 17:16:40.000000000 +0100 -@@ -1,4 +1,5 @@ - #!/usr/bin/perl -w -+# $Id$ - - BEGIN { - if( $ENV{PERL_CORE} ) { diff -urN perl-5.10.0.orig/lib/Test/Simple/t/lib/Dev/Null.pm perl-5.10.0/lib/Test/Simple/t/lib/Dev/Null.pm --- perl-5.10.0.orig/lib/Test/Simple/t/lib/Dev/Null.pm 1970-01-01 01:00:00.000000000 +0100 -+++ perl-5.10.0/lib/Test/Simple/t/lib/Dev/Null.pm 2009-02-17 17:16:40.000000000 +0100 -@@ -0,0 +1,7 @@ ++++ perl-5.10.0/lib/Test/Simple/t/lib/Dev/Null.pm 2009-08-26 06:14:11.000000000 +0200 +@@ -0,0 +1,8 @@ +package Dev::Null; -+# $Id$ + -+sub TIEHANDLE { bless {} } ++use strict; ++ ++sub TIEHANDLE { bless {}, shift } +sub PRINT { 1 } + +1; diff -urN perl-5.10.0.orig/lib/Test/Simple/t/lib/Dummy.pm perl-5.10.0/lib/Test/Simple/t/lib/Dummy.pm --- perl-5.10.0.orig/lib/Test/Simple/t/lib/Dummy.pm 2007-12-18 11:47:07.000000000 +0100 -+++ perl-5.10.0/lib/Test/Simple/t/lib/Dummy.pm 2009-02-17 17:16:40.000000000 +0100 ++++ perl-5.10.0/lib/Test/Simple/t/lib/Dummy.pm 2009-08-26 06:14:11.000000000 +0200 @@ -1,5 +1,6 @@ package Dummy; -+# $Id$ - $VERSION = '0.01'; +-$VERSION = '0.01'; ++use strict; ++our $VERSION = '0.01'; -1; \ No newline at end of file +1; diff -urN perl-5.10.0.orig/lib/Test/Simple/t/lib/MyOverload.pm perl-5.10.0/lib/Test/Simple/t/lib/MyOverload.pm --- perl-5.10.0.orig/lib/Test/Simple/t/lib/MyOverload.pm 2007-12-18 11:47:07.000000000 +0100 -+++ perl-5.10.0/lib/Test/Simple/t/lib/MyOverload.pm 2009-02-17 17:16:40.000000000 +0100 -@@ -1,11 +1,11 @@ - package Overloaded; -+# $Id$ ++++ perl-5.10.0/lib/Test/Simple/t/lib/MyOverload.pm 2009-08-26 06:14:11.000000000 +0200 +@@ -1,29 +1,30 @@ +-package Overloaded; ++package Overloaded; ##no critic (Modules::RequireFilenameMatchesPackage) ++ ++use strict; sub new { my $class = shift; @@ -4841,9 +6467,12 @@ diff -urN perl-5.10.0.orig/lib/Test/Simple/t/lib/MyOverload.pm perl-5.10.0/lib/T - package Overloaded::Compare; - use vars qw(@ISA); - @ISA = qw(Overloaded); -@@ -13,17 +13,15 @@ +-use vars qw(@ISA); +-@ISA = qw(Overloaded); ++ ++use strict; ++our @ISA = qw(Overloaded); + # Sometimes objects have only comparison ops overloaded and nothing else. # For example, DateTime objects. use overload @@ -4855,8 +6484,11 @@ diff -urN perl-5.10.0.orig/lib/Test/Simple/t/lib/MyOverload.pm perl-5.10.0/lib/T + q{==} => sub { $_[0]->{num} == $_[1] }; package Overloaded::Ify; - use vars qw(@ISA); - @ISA = qw(Overloaded); +-use vars qw(@ISA); +-@ISA = qw(Overloaded); ++ ++use strict; ++our @ISA = qw(Overloaded); use overload - q{""} => sub { $_[0]->{string} }, @@ -4869,24 +6501,20 @@ diff -urN perl-5.10.0.orig/lib/Test/Simple/t/lib/MyOverload.pm perl-5.10.0/lib/T +1; diff -urN perl-5.10.0.orig/lib/Test/Simple/t/lib/SigDie.pm perl-5.10.0/lib/Test/Simple/t/lib/SigDie.pm --- perl-5.10.0.orig/lib/Test/Simple/t/lib/SigDie.pm 1970-01-01 01:00:00.000000000 +0100 -+++ perl-5.10.0/lib/Test/Simple/t/lib/SigDie.pm 2009-02-17 17:16:40.000000000 +0100 -@@ -0,0 +1,6 @@ ++++ perl-5.10.0/lib/Test/Simple/t/lib/SigDie.pm 2009-08-26 06:14:11.000000000 +0200 +@@ -0,0 +1,8 @@ +package SigDie; + -+use vars qw($DIE); ++use strict; ++ ++our $DIE; +$SIG{__DIE__} = sub { $DIE = $@ }; + +1; diff -urN perl-5.10.0.orig/lib/Test/Simple/t/maybe_regex.t perl-5.10.0/lib/Test/Simple/t/maybe_regex.t --- perl-5.10.0.orig/lib/Test/Simple/t/maybe_regex.t 2007-12-18 11:47:07.000000000 +0100 -+++ perl-5.10.0/lib/Test/Simple/t/maybe_regex.t 2009-02-17 17:16:40.000000000 +0100 -@@ -1,4 +1,5 @@ - #!/usr/bin/perl -w -+# $Id$ - - BEGIN { - if( $ENV{PERL_CORE} ) { -@@ -11,22 +12,24 @@ ++++ perl-5.10.0/lib/Test/Simple/t/maybe_regex.t 2009-08-26 06:14:11.000000000 +0200 +@@ -11,22 +11,24 @@ } use strict; @@ -4924,13 +6552,8 @@ diff -urN perl-5.10.0.orig/lib/Test/Simple/t/maybe_regex.t perl-5.10.0/lib/Test/ { diff -urN perl-5.10.0.orig/lib/Test/Simple/t/missing.t perl-5.10.0/lib/Test/Simple/t/missing.t --- perl-5.10.0.orig/lib/Test/Simple/t/missing.t 2007-12-18 11:47:07.000000000 +0100 -+++ perl-5.10.0/lib/Test/Simple/t/missing.t 2009-02-17 17:16:40.000000000 +0100 -@@ -1,3 +1,4 @@ -+# $Id$ - BEGIN { - if( $ENV{PERL_CORE} ) { - chdir 't'; -@@ -33,19 +34,23 @@ ++++ perl-5.10.0/lib/Test/Simple/t/missing.t 2009-08-26 06:14:11.000000000 +0200 +@@ -33,19 +33,23 @@ #line 30 ok(1, 'Foo'); ok(0, 'Bar'); @@ -4956,9 +6579,39 @@ diff -urN perl-5.10.0.orig/lib/Test/Simple/t/missing.t perl-5.10.0/lib/Test/Simp ERR exit 0; +diff -urN perl-5.10.0.orig/lib/Test/Simple/t/More.t perl-5.10.0/lib/Test/Simple/t/More.t +--- perl-5.10.0.orig/lib/Test/Simple/t/More.t 2007-12-18 11:47:07.000000000 +0100 ++++ perl-5.10.0/lib/Test/Simple/t/More.t 2009-08-26 06:14:11.000000000 +0200 +@@ -3,12 +3,12 @@ + BEGIN { + if( $ENV{PERL_CORE} ) { + chdir 't'; +- @INC = qw(../lib lib); ++ @INC = qw(../lib lib ../lib/Test/Simple/t/lib); + } + } + + use lib 't/lib'; +-use Test::More tests => 52; ++use Test::More tests => 53; + + # Make sure we don't mess with $@ or $!. Test at bottom. + my $Err = "this should not be touched"; +@@ -47,6 +47,11 @@ + isa_ok(bless([], "Foo"), "Foo"); + isa_ok([], 'ARRAY'); + isa_ok(\42, 'SCALAR'); ++{ ++ local %Bar::; ++ local @Foo::ISA = 'Bar'; ++ isa_ok( "Foo", "Bar" ); ++} + + + # can_ok() & isa_ok should call can() & isa() on the given object, not diff -urN perl-5.10.0.orig/lib/Test/Simple/t/new_ok.t perl-5.10.0/lib/Test/Simple/t/new_ok.t --- perl-5.10.0.orig/lib/Test/Simple/t/new_ok.t 1970-01-01 01:00:00.000000000 +0100 -+++ perl-5.10.0/lib/Test/Simple/t/new_ok.t 2009-02-17 17:16:40.000000000 +0100 ++++ perl-5.10.0/lib/Test/Simple/t/new_ok.t 2009-08-26 06:14:11.000000000 +0200 @@ -0,0 +1,42 @@ +#!/usr/bin/perl -w + @@ -5002,49 +6655,57 @@ diff -urN perl-5.10.0.orig/lib/Test/Simple/t/new_ok.t perl-5.10.0/lib/Test/Simpl + new_ok(); +}; +is $@, sprintf "new_ok() must be given at least a class at %s line %d.\n", $0, __LINE__ - 2; -diff -urN perl-5.10.0.orig/lib/Test/Simple/t/no_diag.t perl-5.10.0/lib/Test/Simple/t/no_diag.t ---- perl-5.10.0.orig/lib/Test/Simple/t/no_diag.t 2007-12-18 11:47:07.000000000 +0100 -+++ perl-5.10.0/lib/Test/Simple/t/no_diag.t 2009-02-17 17:16:40.000000000 +0100 -@@ -1,4 +1,5 @@ - #!/usr/bin/perl -w -+# $Id$ - - use Test::More 'no_diag', tests => 2; - -diff -urN perl-5.10.0.orig/lib/Test/Simple/t/no_ending.t perl-5.10.0/lib/Test/Simple/t/no_ending.t ---- perl-5.10.0.orig/lib/Test/Simple/t/no_ending.t 2007-12-18 11:47:07.000000000 +0100 -+++ perl-5.10.0/lib/Test/Simple/t/no_ending.t 2009-02-17 17:16:40.000000000 +0100 -@@ -1,3 +1,4 @@ -+# $Id$ - use Test::Builder; - - BEGIN { -diff -urN perl-5.10.0.orig/lib/Test/Simple/t/no_header.t perl-5.10.0/lib/Test/Simple/t/no_header.t ---- perl-5.10.0.orig/lib/Test/Simple/t/no_header.t 2007-12-18 11:47:07.000000000 +0100 -+++ perl-5.10.0/lib/Test/Simple/t/no_header.t 2009-02-17 17:16:40.000000000 +0100 -@@ -1,3 +1,4 @@ -+# $Id$ - BEGIN { - if( $ENV{PERL_CORE} ) { - chdir 't'; +diff -urN perl-5.10.0.orig/lib/Test/Simple/t/no_plan_at_all.t perl-5.10.0/lib/Test/Simple/t/no_plan_at_all.t +--- perl-5.10.0.orig/lib/Test/Simple/t/no_plan_at_all.t 1970-01-01 01:00:00.000000000 +0100 ++++ perl-5.10.0/lib/Test/Simple/t/no_plan_at_all.t 2009-08-26 06:14:44.000000000 +0200 +@@ -0,0 +1,35 @@ ++#!/usr/bin/perl -w ++ ++BEGIN { ++ if( $ENV{PERL_CORE} ) { ++ chdir 't'; ++ @INC = qw(../lib lib ../lib/Test/Simple/t/lib); ++ } ++} ++ ++# Test what happens when no plan is delcared and done_testing() is not seen ++ ++use strict; ++use lib 't/lib'; ++ ++use Test::Builder; ++use Test::Builder::NoOutput; ++ ++my $Test = Test::Builder->new; ++$Test->level(0); ++$Test->plan( tests => 1 ); ++ ++my $tb = Test::Builder::NoOutput->create; ++ ++{ ++ $tb->level(0); ++ $tb->ok(1, "just a test"); ++ $tb->ok(1, " and another"); ++ $tb->_ending; ++} ++ ++$Test->is_eq($tb->read, <<'END', "proper behavior when no plan is seen"); ++ok 1 - just a test ++ok 2 - and another ++# Tests were run but no plan was declared and done_testing() was not seen. ++END diff -urN perl-5.10.0.orig/lib/Test/Simple/t/no_plan.t perl-5.10.0/lib/Test/Simple/t/no_plan.t --- perl-5.10.0.orig/lib/Test/Simple/t/no_plan.t 2007-12-18 11:47:07.000000000 +0100 -+++ perl-5.10.0/lib/Test/Simple/t/no_plan.t 2009-02-17 17:16:40.000000000 +0100 -@@ -1,4 +1,5 @@ - #!/usr/bin/perl -w -+# $Id$ - - BEGIN { - if( $ENV{PERL_CORE} ) { -@@ -10,19 +11,29 @@ ++++ perl-5.10.0/lib/Test/Simple/t/no_plan.t 2009-08-26 06:14:11.000000000 +0200 +@@ -10,19 +10,24 @@ } } -use Test::More tests => 6; -+use Test::More tests => 9; ++use Test::More tests => 7; my $tb = Test::Builder->create; - $tb->level(0); +-$tb->level(0); -#line 19 +#line 20 @@ -5059,26 +6720,22 @@ diff -urN perl-5.10.0.orig/lib/Test/Simple/t/no_plan.t perl-5.10.0/lib/Test/Simp +is($@, "You said to run 0 tests at $0 line 24.\n"); -#line 27 -+#line 28 - ok !eval { $tb->ok(1) }; +-ok !eval { $tb->ok(1) }; -is( $@, "You tried to run a test without a plan at $0 line 27.\n"); -+is( $@, "You tried to run a test without a plan at $0 line 28.\n"); -+ +{ + my $warning = ''; + local $SIG{__WARN__} = sub { $warning .= join '', @_ }; + -+#line 36 ++#line 31 + ok $tb->plan(no_plan => 1); -+ is( $warning, "no_plan takes no arguments at $0 line 36.\n" ); ++ is( $warning, "no_plan takes no arguments at $0 line 31.\n" ); + is $tb->has_plan, 'no_plan'; +} diff -urN perl-5.10.0.orig/lib/Test/Simple/t/no_tests.t perl-5.10.0/lib/Test/Simple/t/no_tests.t --- perl-5.10.0.orig/lib/Test/Simple/t/no_tests.t 1970-01-01 01:00:00.000000000 +0100 -+++ perl-5.10.0/lib/Test/Simple/t/no_tests.t 2009-02-17 17:16:40.000000000 +0100 -@@ -0,0 +1,45 @@ ++++ perl-5.10.0/lib/Test/Simple/t/no_tests.t 2009-08-26 06:14:11.000000000 +0200 +@@ -0,0 +1,44 @@ +#!perl -w -+# $Id$ + +BEGIN { + if( $ENV{PERL_CORE} ) { @@ -5124,10 +6781,9 @@ diff -urN perl-5.10.0.orig/lib/Test/Simple/t/no_tests.t perl-5.10.0/lib/Test/Sim +} diff -urN perl-5.10.0.orig/lib/Test/Simple/t/note.t perl-5.10.0/lib/Test/Simple/t/note.t --- perl-5.10.0.orig/lib/Test/Simple/t/note.t 1970-01-01 01:00:00.000000000 +0100 -+++ perl-5.10.0/lib/Test/Simple/t/note.t 2009-02-17 17:16:40.000000000 +0100 -@@ -0,0 +1,36 @@ ++++ perl-5.10.0/lib/Test/Simple/t/note.t 2009-08-26 06:14:11.000000000 +0200 +@@ -0,0 +1,30 @@ +#!/usr/bin/perl -w -+# $Id$ + +BEGIN { + if( $ENV{PERL_CORE} ) { @@ -5142,54 +6798,188 @@ diff -urN perl-5.10.0.orig/lib/Test/Simple/t/note.t perl-5.10.0/lib/Test/Simple/ +use strict; +use warnings; + -+use TieOut; ++use Test::Builder::NoOutput; + +use Test::More tests => 2; + +{ -+ my $test = Test::More->builder; ++ my $tb = Test::Builder::NoOutput->create; + -+ my $output = tie *FAKEOUT, "TieOut"; -+ my $fail_output = tie *FAKEERR, "TieOut"; -+ $test->output (*FAKEOUT); -+ $test->failure_output(*FAKEERR); ++ $tb->note("foo"); + -+ note("foo"); -+ -+ $test->reset_outputs; ++ $tb->reset_outputs; + -+ is $output->read, "# foo\n"; -+ is $fail_output->read, ''; ++ is $tb->read('out'), "# foo\n"; ++ is $tb->read('err'), ''; +} + -diff -urN perl-5.10.0.orig/lib/Test/Simple/t/ok_obj.t perl-5.10.0/lib/Test/Simple/t/ok_obj.t ---- perl-5.10.0.orig/lib/Test/Simple/t/ok_obj.t 2007-12-18 11:47:07.000000000 +0100 -+++ perl-5.10.0/lib/Test/Simple/t/ok_obj.t 2009-02-17 17:16:40.000000000 +0100 -@@ -1,4 +1,5 @@ - #!/usr/bin/perl -w -+# $Id$ - - # Testing to make sure Test::Builder doesn't accidentally store objects - # passed in as test arguments. diff -urN perl-5.10.0.orig/lib/Test/Simple/t/output.t perl-5.10.0/lib/Test/Simple/t/output.t --- perl-5.10.0.orig/lib/Test/Simple/t/output.t 2007-12-18 11:47:07.000000000 +0100 -+++ perl-5.10.0/lib/Test/Simple/t/output.t 2009-02-17 17:16:40.000000000 +0100 -@@ -1,4 +1,5 @@ ++++ perl-5.10.0/lib/Test/Simple/t/output.t 2009-08-26 06:14:11.000000000 +0200 +@@ -1,5 +1,7 @@ #!perl -w -+# $Id$ ++use strict; ++ BEGIN { if( $ENV{PERL_CORE} ) { + chdir 't'; +@@ -11,76 +13,91 @@ + } + chdir 't'; + ++use Test::Builder; + +-# Can't use Test.pm, that's a 5.005 thing. +-print "1..4\n"; ++# The real Test::Builder ++my $Test = Test::Builder->new; ++$Test->plan( tests => 6 ); + +-my $test_num = 1; +-# Utility testing functions. +-sub ok ($;$) { +- my($test, $name) = @_; +- my $ok = ''; +- $ok .= "not " unless $test; +- $ok .= "ok $test_num"; +- $ok .= " - $name" if defined $name; +- $ok .= "\n"; +- print $ok; +- $test_num++; + +- return $test; +-} +- +-use TieOut; +-use Test::Builder; +-my $Test = Test::Builder->new(); ++# The one we're going to test. ++my $tb = Test::Builder->create(); + +-my $result; + my $tmpfile = 'foo.tmp'; +-my $out = $Test->output($tmpfile); + END { 1 while unlink($tmpfile) } + +-ok( defined $out ); ++# Test output to a file ++{ ++ my $out = $tb->output($tmpfile); ++ $Test->ok( defined $out ); ++ ++ print $out "hi!\n"; ++ close *$out; ++ ++ undef $out; ++ open(IN, $tmpfile) or die $!; ++ chomp(my $line = ); ++ close IN; ++ ++ $Test->is_eq($line, 'hi!'); ++} + +-print $out "hi!\n"; +-close *$out; + +-undef $out; +-open(IN, $tmpfile) or die $!; +-chomp(my $line = ); +-close IN; +- +-ok($line eq 'hi!'); +- +-open(FOO, ">>$tmpfile") or die $!; +-$out = $Test->output(\*FOO); +-$old = select *$out; +-print "Hello!\n"; +-close *$out; +-undef $out; +-select $old; +-open(IN, $tmpfile) or die $!; +-my @lines = ; +-close IN; ++# Test output to a filehandle ++{ ++ open(FOO, ">>$tmpfile") or die $!; ++ my $out = $tb->output(\*FOO); ++ my $old = select *$out; ++ print "Hello!\n"; ++ close *$out; ++ undef $out; ++ select $old; ++ open(IN, $tmpfile) or die $!; ++ my @lines = ; ++ close IN; + +-ok($lines[1] =~ /Hello!/); ++ $Test->like($lines[1], qr/Hello!/); ++} + + ++# Test output to a scalar ref ++{ ++ my $scalar = ''; ++ my $out = $tb->output(\$scalar); ++ ++ print $out "Hey hey hey!\n"; ++ $Test->is_eq($scalar, "Hey hey hey!\n"); ++} ++ ++ ++# Test we can output to the same scalar ref ++{ ++ my $scalar = ''; ++ my $out = $tb->output(\$scalar); ++ my $err = $tb->failure_output(\$scalar); ++ ++ print $out "To output "; ++ print $err "and beyond!"; ++ ++ $Test->is_eq($scalar, "To output and beyond!", "One scalar, two filehandles"); ++} ++ + + # Ensure stray newline in name escaping works. +-$out = tie *FAKEOUT, 'TieOut'; +-$Test->output(\*FAKEOUT); +-$Test->exported_to(__PACKAGE__); +-$Test->no_ending(1); +-$Test->plan(tests => 5); +- +-$Test->ok(1, "ok"); +-$Test->ok(1, "ok\n"); +-$Test->ok(1, "ok, like\nok"); +-$Test->skip("wibble\nmoof"); +-$Test->todo_skip("todo\nskip\n"); ++{ ++ my $fakeout = ''; ++ my $out = $tb->output(\$fakeout); ++ $tb->exported_to(__PACKAGE__); ++ $tb->no_ending(1); ++ $tb->plan(tests => 5); ++ ++ $tb->ok(1, "ok"); ++ $tb->ok(1, "ok\n"); ++ $tb->ok(1, "ok, like\nok"); ++ $tb->skip("wibble\nmoof"); ++ $tb->todo_skip("todo\nskip\n"); + +-my $output = $out->read; +-ok( $output eq <is_eq( $fakeout, < 13; - } -} -+use Test::More tests => 15; ++use Test::More tests => 19; package Overloaded; @@ -5211,9 +7001,9 @@ diff -urN perl-5.10.0.orig/lib/Test/Simple/t/overload.t perl-5.10.0/lib/Test/Sim use overload - q{""} => sub { $_[0]->{string} }, - q{0+} => sub { $_[0]->{num} }; -+ q{eq} => sub { $_[0]->{string} }, -+ q{==} => sub { $_[0]->{num} }, -+ q{""} => sub { $_[0]->{stringfy}++; $_[0]->{string} }, ++ q{eq} => sub { $_[0]->{string} eq $_[1] }, ++ q{==} => sub { $_[0]->{num} == $_[1] }, ++ q{""} => sub { $_[0]->{stringify}++; $_[0]->{string} }, + q{0+} => sub { $_[0]->{numify}++; $_[0]->{num} } +; @@ -5229,26 +7019,40 @@ diff -urN perl-5.10.0.orig/lib/Test/Simple/t/overload.t perl-5.10.0/lib/Test/Sim } -@@ -48,7 +48,9 @@ +@@ -46,9 +45,11 @@ + my $obj = Overloaded->new('foo', 42); + isa_ok $obj, 'Overloaded'; - is $obj, 'foo', 'is() with string overloading'; - cmp_ok $obj, 'eq', 'foo', 'cmp_ok() ...'; -+is $obj->{stringify}, 0, 'cmp_ok() eq does not stringify'; - cmp_ok $obj, '==', 42, 'cmp_ok() with number overloading'; -+is $obj->{numify}, 0, 'cmp_ok() == does not numify'; +-is $obj, 'foo', 'is() with string overloading'; +-cmp_ok $obj, 'eq', 'foo', 'cmp_ok() ...'; +-cmp_ok $obj, '==', 42, 'cmp_ok() with number overloading'; ++cmp_ok $obj, 'eq', 'foo', 'cmp_ok() eq'; ++is $obj->{stringify}, 0, ' does not stringify'; ++is $obj, 'foo', 'is() with string overloading'; ++cmp_ok $obj, '==', 42, 'cmp_ok() with number overloading'; ++is $obj->{numify}, 0, ' does not numify'; is_deeply [$obj], ['foo'], 'is_deeply with string overloading'; ok eq_array([$obj], ['foo']), 'eq_array ...'; +@@ -72,3 +73,14 @@ + {'TestPackage' => 'TestPackage'}); + ::is_deeply('TestPackage', 'TestPackage'); + } ++ ++ ++# Make sure 0 isn't a special case. [rt.cpan.org 41109] ++{ ++ my $obj = Overloaded->new('0', 42); ++ isa_ok $obj, 'Overloaded'; ++ ++ cmp_ok $obj, 'eq', '0', 'cmp_ok() eq'; ++ is $obj->{stringify}, 0, ' does not stringify'; ++ is $obj, '0', 'is() with string overloading'; ++} diff -urN perl-5.10.0.orig/lib/Test/Simple/t/overload_threads.t perl-5.10.0/lib/Test/Simple/t/overload_threads.t --- perl-5.10.0.orig/lib/Test/Simple/t/overload_threads.t 2007-12-18 11:47:07.000000000 +0100 -+++ perl-5.10.0/lib/Test/Simple/t/overload_threads.t 2009-02-17 17:16:40.000000000 +0100 -@@ -1,4 +1,5 @@ - #!perl -w -+# $Id$ - - BEGIN { - if( $ENV{PERL_CORE} ) { -@@ -17,16 +18,7 @@ ++++ perl-5.10.0/lib/Test/Simple/t/overload_threads.t 2009-08-26 06:14:11.000000000 +0200 +@@ -17,16 +17,7 @@ eval { require threads; 'threads'->import; 1; }; } @@ -5266,25 +7070,10 @@ diff -urN perl-5.10.0.orig/lib/Test/Simple/t/overload_threads.t perl-5.10.0/lib/ package Overloaded; -diff -urN perl-5.10.0.orig/lib/Test/Simple/t/plan.t perl-5.10.0/lib/Test/Simple/t/plan.t ---- perl-5.10.0.orig/lib/Test/Simple/t/plan.t 2007-12-18 11:47:07.000000000 +0100 -+++ perl-5.10.0/lib/Test/Simple/t/plan.t 2009-02-17 17:16:40.000000000 +0100 -@@ -1,4 +1,5 @@ - #!/usr/bin/perl -w -+# $Id$ - - BEGIN { - if( $ENV{PERL_CORE} ) { diff -urN perl-5.10.0.orig/lib/Test/Simple/t/plan_bad.t perl-5.10.0/lib/Test/Simple/t/plan_bad.t --- perl-5.10.0.orig/lib/Test/Simple/t/plan_bad.t 2007-12-18 11:47:07.000000000 +0100 -+++ perl-5.10.0/lib/Test/Simple/t/plan_bad.t 2009-02-17 17:16:40.000000000 +0100 -@@ -1,4 +1,5 @@ - #!/usr/bin/perl -w -+# $Id$ - - BEGIN { - if( $ENV{PERL_CORE} ) { -@@ -8,7 +9,7 @@ ++++ perl-5.10.0/lib/Test/Simple/t/plan_bad.t 2009-08-26 06:14:11.000000000 +0200 +@@ -8,7 +8,7 @@ } @@ -5293,7 +7082,7 @@ diff -urN perl-5.10.0.orig/lib/Test/Simple/t/plan_bad.t perl-5.10.0/lib/Test/Sim use Test::Builder; my $tb = Test::Builder->create; $tb->level(0); -@@ -21,6 +22,9 @@ +@@ -21,6 +21,9 @@ ok !eval { $tb->plan( tests => @foo ) }; is $@, sprintf "Number of tests must be a positive integer. You gave it '$foo' at %s line %d.\n", $0, __LINE__ - 1; @@ -5305,88 +7094,76 @@ diff -urN perl-5.10.0.orig/lib/Test/Simple/t/plan_bad.t perl-5.10.0/lib/Test/Sim is $@, "Number of tests must be a positive integer. You gave it '-1' at $0 line 25.\n"; diff -urN perl-5.10.0.orig/lib/Test/Simple/t/plan_is_noplan.t perl-5.10.0/lib/Test/Simple/t/plan_is_noplan.t --- perl-5.10.0.orig/lib/Test/Simple/t/plan_is_noplan.t 2007-12-18 11:47:07.000000000 +0100 -+++ perl-5.10.0/lib/Test/Simple/t/plan_is_noplan.t 2009-02-17 17:16:40.000000000 +0100 -@@ -1,3 +1,4 @@ -+# $Id$ - BEGIN { - if( $ENV{PERL_CORE} ) { - chdir 't'; -diff -urN perl-5.10.0.orig/lib/Test/Simple/t/plan_no_plan.t perl-5.10.0/lib/Test/Simple/t/plan_no_plan.t ---- perl-5.10.0.orig/lib/Test/Simple/t/plan_no_plan.t 2007-12-18 11:47:07.000000000 +0100 -+++ perl-5.10.0/lib/Test/Simple/t/plan_no_plan.t 2009-02-17 17:16:40.000000000 +0100 -@@ -1,3 +1,4 @@ -+# $Id$ - BEGIN { - if( $ENV{PERL_CORE} ) { - chdir 't'; -diff -urN perl-5.10.0.orig/lib/Test/Simple/t/plan_shouldnt_import.t perl-5.10.0/lib/Test/Simple/t/plan_shouldnt_import.t ---- perl-5.10.0.orig/lib/Test/Simple/t/plan_shouldnt_import.t 2007-12-18 11:47:07.000000000 +0100 -+++ perl-5.10.0/lib/Test/Simple/t/plan_shouldnt_import.t 2009-02-17 17:16:40.000000000 +0100 -@@ -1,4 +1,5 @@ - #!/usr/bin/perl -w -+# $Id$ - - # plan() used to export functions by mistake [rt.cpan.org 8385] - -diff -urN perl-5.10.0.orig/lib/Test/Simple/t/plan_skip_all.t perl-5.10.0/lib/Test/Simple/t/plan_skip_all.t ---- perl-5.10.0.orig/lib/Test/Simple/t/plan_skip_all.t 2007-12-18 11:47:07.000000000 +0100 -+++ perl-5.10.0/lib/Test/Simple/t/plan_skip_all.t 2009-02-17 17:16:40.000000000 +0100 -@@ -1,3 +1,4 @@ -+# $Id$ ++++ perl-5.10.0/lib/Test/Simple/t/plan_is_noplan.t 2009-08-26 06:14:11.000000000 +0200 +@@ -1,3 +1,5 @@ ++#!/usr/bin/perl -w ++ BEGIN { if( $ENV{PERL_CORE} ) { chdir 't'; -diff -urN perl-5.10.0.orig/lib/Test/Simple/t/require_ok.t perl-5.10.0/lib/Test/Simple/t/require_ok.t ---- perl-5.10.0.orig/lib/Test/Simple/t/require_ok.t 2007-12-18 11:47:07.000000000 +0100 -+++ perl-5.10.0/lib/Test/Simple/t/require_ok.t 2009-02-17 17:16:40.000000000 +0100 -@@ -1,4 +1,5 @@ - #!/usr/bin/perl -w -+# $Id$ +@@ -8,47 +10,23 @@ + } + } - BEGIN { - if( $ENV{PERL_CORE} ) { -diff -urN perl-5.10.0.orig/lib/Test/Simple/t/reset.t perl-5.10.0/lib/Test/Simple/t/reset.t ---- perl-5.10.0.orig/lib/Test/Simple/t/reset.t 2007-12-18 11:47:07.000000000 +0100 -+++ perl-5.10.0/lib/Test/Simple/t/reset.t 2009-02-17 17:16:40.000000000 +0100 -@@ -1,4 +1,5 @@ - #!/usr/bin/perl -w -+# $Id$ +-# Can't use Test.pm, that's a 5.005 thing. +-package My::Test; +- +-print "1..2\n"; +- +-my $test_num = 1; +-# Utility testing functions. +-sub ok ($;$) { +- my($test, $name) = @_; +- my $ok = ''; +- $ok .= "not " unless $test; +- $ok .= "ok $test_num"; +- $ok .= " - $name" if defined $name; +- $ok .= "\n"; +- print $ok; +- $test_num++; +-} +- ++use strict; - # Test Test::Builder->reset; +-package main; ++use Test::More tests => 1; -@@ -16,6 +17,11 @@ +-require Test::Simple; ++use Test::Builder::NoOutput; - use Test::Builder; - my $tb = Test::Builder->new; -+ -+my %Original_Output; -+$Original_Output{$_} = $tb->$_ for qw(output failure_output todo_output); -+ -+ - $tb->plan(tests => 14); - $tb->level(0); +-require Test::Simple::Catch; +-my($out, $err) = Test::Simple::Catch::caught(); ++{ ++ my $tb = Test::Builder::NoOutput->create; -@@ -66,11 +72,11 @@ - ok( $tb->use_numbers == 1, 'use_numbers' ); - ok( $tb->no_header == 0, 'no_header' ); - ok( $tb->no_ending == 0, 'no_ending' ); --ok( fileno $tb->output == fileno *Test::Builder::TESTOUT, -+ok( fileno $tb->output == fileno $Original_Output{output}, - 'output' ); --ok( fileno $tb->failure_output == fileno *Test::Builder::TESTERR, -+ok( fileno $tb->failure_output == fileno $Original_Output{failure_output}, - 'failure_output' ); --ok( fileno $tb->todo_output == fileno *Test::Builder::TESTOUT, -+ok( fileno $tb->todo_output == fileno $Original_Output{todo_output}, - 'todo_output' ); - ok( $tb->current_test == 0, 'current_test' ); - ok( $tb->summary == 0, 'summary' ); ++ $tb->plan('no_plan'); + +-Test::Simple->import('no_plan'); ++ $tb->ok(1, 'foo'); ++ $tb->_ending; + +-ok(1, 'foo'); +- +- +-END { +- My::Test::ok($$out eq <read, <$method(), $original_outputs{$method}, "reset_outputs() resets $method"; + } +} -diff -urN perl-5.10.0.orig/lib/Test/Simple/t/simple.t perl-5.10.0/lib/Test/Simple/t/simple.t ---- perl-5.10.0.orig/lib/Test/Simple/t/simple.t 2007-12-18 11:47:07.000000000 +0100 -+++ perl-5.10.0/lib/Test/Simple/t/simple.t 2009-02-17 17:16:40.000000000 +0100 -@@ -1,3 +1,4 @@ -+# $Id$ - BEGIN { - if( $ENV{PERL_CORE} ) { - chdir 't'; -diff -urN perl-5.10.0.orig/lib/Test/Simple/t/skip.t perl-5.10.0/lib/Test/Simple/t/skip.t ---- perl-5.10.0.orig/lib/Test/Simple/t/skip.t 2007-12-18 11:47:07.000000000 +0100 -+++ perl-5.10.0/lib/Test/Simple/t/skip.t 2009-02-17 17:16:40.000000000 +0100 -@@ -1,4 +1,5 @@ - #!perl -w -+# $Id$ +diff -urN perl-5.10.0.orig/lib/Test/Simple/t/reset.t perl-5.10.0/lib/Test/Simple/t/reset.t +--- perl-5.10.0.orig/lib/Test/Simple/t/reset.t 2007-12-18 11:47:07.000000000 +0100 ++++ perl-5.10.0/lib/Test/Simple/t/reset.t 2009-08-26 06:14:11.000000000 +0200 +@@ -15,19 +15,23 @@ - BEGIN { - if( $ENV{PERL_CORE} ) { + + use Test::Builder; +-my $tb = Test::Builder->new; +-$tb->plan(tests => 14); +-$tb->level(0); ++my $Test = Test::Builder->new; ++my $tb = Test::Builder->create; ++ ++# We'll need this later to know the outputs were reset ++my %Original_Output; ++$Original_Output{$_} = $tb->$_ for qw(output failure_output todo_output); + + # Alter the state of Test::Builder as much as possible. +-$tb->ok(1, "Running a test to alter TB's state"); ++my $output = ''; ++$tb->output(\$output); ++$tb->failure_output(\$output); ++$tb->todo_output(\$output); + +-my $tmpfile = 'foo.tmp'; ++$tb->plan(tests => 14); ++$tb->level(0); + +-$tb->output($tmpfile); +-$tb->failure_output($tmpfile); +-$tb->todo_output($tmpfile); +-END { 1 while unlink $tmpfile } ++$tb->ok(1, "Running a test to alter TB's state"); + + # This won't print since we just sent output off to oblivion. + $tb->ok(0, "And a failure for fun"); +@@ -44,41 +48,26 @@ + # Now reset it. + $tb->reset; + +-my $test_num = 2; # since we already printed 1 +-# Utility testing functions. +-sub ok ($;$) { +- my($test, $name) = @_; +- my $ok = ''; +- $ok .= "not " unless $test; +- $ok .= "ok $test_num"; +- $ok .= " - $name" if defined $name; +- $ok .= "\n"; +- print $ok; +- $test_num++; +- +- return $test; +-} +- +- +-ok( !defined $tb->exported_to, 'exported_to' ); +-ok( $tb->expected_tests == 0, 'expected_tests' ); +-ok( $tb->level == 1, 'level' ); +-ok( $tb->use_numbers == 1, 'use_numbers' ); +-ok( $tb->no_header == 0, 'no_header' ); +-ok( $tb->no_ending == 0, 'no_ending' ); +-ok( fileno $tb->output == fileno *Test::Builder::TESTOUT, +- 'output' ); +-ok( fileno $tb->failure_output == fileno *Test::Builder::TESTERR, +- 'failure_output' ); +-ok( fileno $tb->todo_output == fileno *Test::Builder::TESTOUT, +- 'todo_output' ); +-ok( $tb->current_test == 0, 'current_test' ); +-ok( $tb->summary == 0, 'summary' ); +-ok( $tb->details == 0, 'details' ); + +-$tb->no_ending(1); +-$tb->no_header(1); +-$tb->plan(tests => 14); +-$tb->current_test(13); ++$Test->ok( !defined $tb->exported_to, 'exported_to' ); ++$Test->is_eq( $tb->expected_tests, 0, 'expected_tests' ); ++$Test->is_eq( $tb->level, 1, 'level' ); ++$Test->is_eq( $tb->use_numbers, 1, 'use_numbers' ); ++$Test->is_eq( $tb->no_header, 0, 'no_header' ); ++$Test->is_eq( $tb->no_ending, 0, 'no_ending' ); ++$Test->is_eq( $tb->current_test, 0, 'current_test' ); ++$Test->is_eq( scalar $tb->summary, 0, 'summary' ); ++$Test->is_eq( scalar $tb->details, 0, 'details' ); ++$Test->is_eq( fileno $tb->output, ++ fileno $Original_Output{output}, 'output' ); ++$Test->is_eq( fileno $tb->failure_output, ++ fileno $Original_Output{failure_output}, 'failure_output' ); ++$Test->is_eq( fileno $tb->todo_output, ++ fileno $Original_Output{todo_output}, 'todo_output' ); ++ ++$tb->current_test(12); + $tb->level(0); + $tb->ok(1, 'final test to make sure output was reset'); ++ ++$Test->current_test(13); ++$Test->done_testing(13); diff -urN perl-5.10.0.orig/lib/Test/Simple/t/skipall.t perl-5.10.0/lib/Test/Simple/t/skipall.t --- perl-5.10.0.orig/lib/Test/Simple/t/skipall.t 2007-12-18 11:47:07.000000000 +0100 -+++ perl-5.10.0/lib/Test/Simple/t/skipall.t 2009-02-17 17:16:40.000000000 +0100 -@@ -1,3 +1,4 @@ -+# $Id$ ++++ perl-5.10.0/lib/Test/Simple/t/skipall.t 2009-08-26 06:14:11.000000000 +0200 +@@ -1,3 +1,5 @@ ++#!/usr/bin/perl -w ++ BEGIN { if( $ENV{PERL_CORE} ) { chdir 't'; +@@ -10,35 +12,22 @@ + + use strict; + +-# Can't use Test.pm, that's a 5.005 thing. +-package My::Test; +- +-print "1..2\n"; +- +-my $test_num = 1; +-# Utility testing functions. +-sub ok ($;$) { +- my($test, $name) = @_; +- my $ok = ''; +- $ok .= "not " unless $test; +- $ok .= "ok $test_num"; +- $ok .= " - $name" if defined $name; +- $ok .= "\n"; +- print $ok; +- $test_num++; +-} ++use Test::More; + ++my $Test = Test::Builder->create; ++$Test->plan(tests => 2); + +-package main; +-require Test::More; +- +-require Test::Simple::Catch; +-my($out, $err) = Test::Simple::Catch::caught(); +- +-Test::More->import('skip_all'); ++my $out = ''; ++my $err = ''; ++{ ++ my $tb = Test::More->builder; ++ $tb->output(\$out); ++ $tb->failure_output(\$err); + ++ plan 'skip_all'; ++} + + END { +- My::Test::ok($$out eq "1..0\n"); +- My::Test::ok($$err eq ""); ++ $Test->is_eq($out, "1..0 # SKIP\n"); ++ $Test->is_eq($err, ""); + } +diff -urN perl-5.10.0.orig/lib/Test/Simple/t/skip.t perl-5.10.0/lib/Test/Simple/t/skip.t +--- perl-5.10.0.orig/lib/Test/Simple/t/skip.t 2007-12-18 11:47:07.000000000 +0100 ++++ perl-5.10.0/lib/Test/Simple/t/skip.t 2009-08-26 06:14:11.000000000 +0200 +@@ -94,5 +94,5 @@ + pass "This does not run"; + } + +- like $warning, '/^skip\(\) was passed a non-numeric number of tests/'; ++ like $warning, qr/^skip\(\) was passed a non-numeric number of tests/; + } diff -urN perl-5.10.0.orig/lib/Test/Simple/t/tbm_doesnt_set_exported_to.t perl-5.10.0/lib/Test/Simple/t/tbm_doesnt_set_exported_to.t --- perl-5.10.0.orig/lib/Test/Simple/t/tbm_doesnt_set_exported_to.t 1970-01-01 01:00:00.000000000 +0100 -+++ perl-5.10.0/lib/Test/Simple/t/tbm_doesnt_set_exported_to.t 2009-02-17 17:16:40.000000000 +0100 -@@ -0,0 +1,25 @@ ++++ perl-5.10.0/lib/Test/Simple/t/tbm_doesnt_set_exported_to.t 2009-08-26 06:14:11.000000000 +0200 +@@ -0,0 +1,24 @@ +#!/usr/bin/perl -w -+# $Id$ + +BEGIN { + if( $ENV{PERL_CORE} ) { @@ -5475,125 +7392,20 @@ diff -urN perl-5.10.0.orig/lib/Test/Simple/t/tbm_doesnt_set_exported_to.t perl-5 + undef, + 'using Test::Builder::Module does not set exported_to()' +); -diff -urN perl-5.10.0.orig/lib/Test/Simple/t/tbt_01basic.t perl-5.10.0/lib/Test/Simple/t/tbt_01basic.t ---- perl-5.10.0.orig/lib/Test/Simple/t/tbt_01basic.t 2007-12-18 11:47:07.000000000 +0100 -+++ perl-5.10.0/lib/Test/Simple/t/tbt_01basic.t 2009-02-17 17:16:40.000000000 +0100 -@@ -1,4 +1,5 @@ - #!/usr/bin/perl -+# $Id$ - - use Test::Builder::Tester tests => 9; - use Test::More; -@@ -22,7 +23,7 @@ - test_test("multiple tests"); - - test_out("not ok 1 - should fail"); --test_err("# Failed test ($0 at line 28)"); -+test_err("# Failed test ($0 at line 29)"); - test_err("# got: 'foo'"); - test_err("# expected: 'bar'"); - is("foo","bar","should fail"); -@@ -46,7 +47,7 @@ - - - test_out("not ok 1 - name # TODO Something"); --test_err("# Failed (TODO) test ($0 at line 52)"); -+test_err("# Failed (TODO) test ($0 at line 53)"); - TODO: { - local $TODO = "Something"; - fail("name"); -diff -urN perl-5.10.0.orig/lib/Test/Simple/t/tbt_02fhrestore.t perl-5.10.0/lib/Test/Simple/t/tbt_02fhrestore.t ---- perl-5.10.0.orig/lib/Test/Simple/t/tbt_02fhrestore.t 2007-12-18 11:47:07.000000000 +0100 -+++ perl-5.10.0/lib/Test/Simple/t/tbt_02fhrestore.t 2009-02-17 17:16:40.000000000 +0100 -@@ -1,4 +1,5 @@ - #!/usr/bin/perl -+# $Id$ - - use Test::Builder::Tester tests => 4; - use Test::More; -diff -urN perl-5.10.0.orig/lib/Test/Simple/t/tbt_03die.t perl-5.10.0/lib/Test/Simple/t/tbt_03die.t ---- perl-5.10.0.orig/lib/Test/Simple/t/tbt_03die.t 2007-12-18 11:47:07.000000000 +0100 -+++ perl-5.10.0/lib/Test/Simple/t/tbt_03die.t 2009-02-17 17:16:40.000000000 +0100 -@@ -1,4 +1,5 @@ - #!/usr/bin/perl -+# $Id$ - - use Test::Builder::Tester tests => 1; - use Test::More; -diff -urN perl-5.10.0.orig/lib/Test/Simple/t/tbt_04line_num.t perl-5.10.0/lib/Test/Simple/t/tbt_04line_num.t ---- perl-5.10.0.orig/lib/Test/Simple/t/tbt_04line_num.t 2007-12-18 11:47:07.000000000 +0100 -+++ perl-5.10.0/lib/Test/Simple/t/tbt_04line_num.t 2009-02-17 17:16:40.000000000 +0100 -@@ -1,8 +1,9 @@ - #!/usr/bin/perl -+# $Id$ - - use Test::More tests => 3; - use Test::Builder::Tester; - --is(line_num(),6,"normal line num"); --is(line_num(-1),6,"line number minus one"); --is(line_num(+2),10,"line number plus two"); -+is(line_num(),7,"normal line num"); -+is(line_num(-1),7,"line number minus one"); -+is(line_num(+2),11,"line number plus two"); -diff -urN perl-5.10.0.orig/lib/Test/Simple/t/tbt_05faildiag.t perl-5.10.0/lib/Test/Simple/t/tbt_05faildiag.t ---- perl-5.10.0.orig/lib/Test/Simple/t/tbt_05faildiag.t 2007-12-18 11:47:07.000000000 +0100 -+++ perl-5.10.0/lib/Test/Simple/t/tbt_05faildiag.t 2009-02-17 17:16:40.000000000 +0100 -@@ -1,4 +1,5 @@ - #!/usr/bin/perl -+# $Id$ - - use Test::Builder::Tester tests => 5; - use Test::More; -diff -urN perl-5.10.0.orig/lib/Test/Simple/t/tbt_06errormess.t perl-5.10.0/lib/Test/Simple/t/tbt_06errormess.t ---- perl-5.10.0.orig/lib/Test/Simple/t/tbt_06errormess.t 2007-12-18 11:47:07.000000000 +0100 -+++ perl-5.10.0/lib/Test/Simple/t/tbt_06errormess.t 2009-02-17 17:16:40.000000000 +0100 -@@ -1,4 +1,5 @@ - #!/usr/bin/perl -w -+# $Id$ - - use Test::More tests => 8; - use Symbol; -diff -urN perl-5.10.0.orig/lib/Test/Simple/t/tbt_07args.t perl-5.10.0/lib/Test/Simple/t/tbt_07args.t ---- perl-5.10.0.orig/lib/Test/Simple/t/tbt_07args.t 2007-12-18 11:47:07.000000000 +0100 -+++ perl-5.10.0/lib/Test/Simple/t/tbt_07args.t 2009-02-17 17:16:40.000000000 +0100 -@@ -1,4 +1,5 @@ - #!/usr/bin/perl -w -+# $Id$ - - use Test::More tests => 18; - use Symbol; diff -urN perl-5.10.0.orig/lib/Test/Simple/t/thread_taint.t perl-5.10.0/lib/Test/Simple/t/thread_taint.t --- perl-5.10.0.orig/lib/Test/Simple/t/thread_taint.t 2007-12-18 11:47:07.000000000 +0100 -+++ perl-5.10.0/lib/Test/Simple/t/thread_taint.t 2009-02-17 17:16:40.000000000 +0100 -@@ -1,5 +1,6 @@ - #!/usr/bin/perl -w -+# $Id$ ++++ perl-5.10.0/lib/Test/Simple/t/thread_taint.t 2009-08-26 06:14:11.000000000 +0200 +@@ -2,4 +2,4 @@ use Test::More tests => 1; -ok( !$INC{'threads.pm'}, 'Loading Test::More does not load threads.pm' ); \ No newline at end of file +ok( !$INC{'threads.pm'}, 'Loading Test::More does not load threads.pm' ); -diff -urN perl-5.10.0.orig/lib/Test/Simple/t/threads.t perl-5.10.0/lib/Test/Simple/t/threads.t ---- perl-5.10.0.orig/lib/Test/Simple/t/threads.t 2007-12-18 11:47:07.000000000 +0100 -+++ perl-5.10.0/lib/Test/Simple/t/threads.t 2009-02-17 17:16:41.000000000 +0100 -@@ -1,4 +1,5 @@ - #!/usr/bin/perl -w -+# $Id$ - - BEGIN { - if( $ENV{PERL_CORE} ) { diff -urN perl-5.10.0.orig/lib/Test/Simple/t/todo.t perl-5.10.0/lib/Test/Simple/t/todo.t --- perl-5.10.0.orig/lib/Test/Simple/t/todo.t 2007-12-18 11:47:07.000000000 +0100 -+++ perl-5.10.0/lib/Test/Simple/t/todo.t 2009-02-17 17:16:41.000000000 +0100 -@@ -1,4 +1,5 @@ - #!perl -w -+# $Id$ - - BEGIN { - if( $ENV{PERL_CORE} ) { -@@ -9,7 +10,7 @@ ++++ perl-5.10.0/lib/Test/Simple/t/todo.t 2009-08-26 06:14:11.000000000 +0200 +@@ -9,7 +9,7 @@ use Test::More; @@ -5602,7 +7414,16 @@ diff -urN perl-5.10.0.orig/lib/Test/Simple/t/todo.t perl-5.10.0/lib/Test/Simple/ $Why = 'Just testing the todo interface.'; -@@ -69,11 +70,89 @@ +@@ -42,7 +42,7 @@ + + ok( 'this' eq 'that', 'ok' ); + +- like( 'this', '/that/', 'like' ); ++ like( 'this', qr/that/, 'like' ); + is( 'this', 'that', 'is' ); + isnt( 'this', 'this', 'isnt' ); + +@@ -69,11 +69,89 @@ # perl gets the line number a little wrong on the first # statement inside a block. 1 == 1; @@ -5696,14 +7517,8 @@ diff -urN perl-5.10.0.orig/lib/Test/Simple/t/todo.t perl-5.10.0/lib/Test/Simple/ +} diff -urN perl-5.10.0.orig/lib/Test/Simple/t/try.t perl-5.10.0/lib/Test/Simple/t/try.t --- perl-5.10.0.orig/lib/Test/Simple/t/try.t 2007-12-18 11:47:07.000000000 +0100 -+++ perl-5.10.0/lib/Test/Simple/t/try.t 2009-02-17 17:16:41.000000000 +0100 -@@ -1,4 +1,5 @@ - #!perl -w -+# $Id$ - - BEGIN { - if( $ENV{PERL_CORE} ) { -@@ -17,19 +18,26 @@ ++++ perl-5.10.0/lib/Test/Simple/t/try.t 2009-08-26 06:14:11.000000000 +0200 +@@ -17,19 +17,26 @@ require Test::Builder; my $tb = Test::Builder->new; @@ -5712,6 +7527,18 @@ diff -urN perl-5.10.0.orig/lib/Test/Simple/t/try.t perl-5.10.0/lib/Test/Simple/t -# These should not change; -local $@ = 42; -local $! = 23; +- +-is $tb->_try(sub { 2 }), 2; +-is $tb->_try(sub { return '' }), ''; +- +-is $tb->_try(sub { die; }), undef; +- +-is_deeply [$tb->_try(sub { die "Foo\n" }, undef)], +- [undef, "Foo\n"]; +- +-is $@, 42; +-cmp_ok $!, '==', 23; +\ No newline at end of file +# Test that _try() has no effect on $@ and $! and is not effected by +# __DIE__ +{ @@ -5721,46 +7548,33 @@ diff -urN perl-5.10.0.orig/lib/Test/Simple/t/try.t perl-5.10.0/lib/Test/Simple/t + + is $tb->_try(sub { 2 }), 2; + is $tb->_try(sub { return '' }), ''; - --is $tb->_try(sub { 2 }), 2; --is $tb->_try(sub { return '' }), ''; ++ + is $tb->_try(sub { die; }), undef; - --is $tb->_try(sub { die; }), undef; ++ + is_deeply [$tb->_try(sub { die "Foo\n" })], [undef, "Foo\n"]; - --is_deeply [$tb->_try(sub { die "Foo\n" }, undef)], -- [undef, "Foo\n"]; ++ + is $@, 42; + cmp_ok $!, '==', 23; +} - --is $@, 42; --cmp_ok $!, '==', 23; -\ No newline at end of file ++ +ok !eval { + $tb->_try(sub { die "Died\n" }, die_on_fail => 1); +}; +is $@, "Died\n"; diff -urN perl-5.10.0.orig/lib/Test/Simple/t/undef.t perl-5.10.0/lib/Test/Simple/t/undef.t --- perl-5.10.0.orig/lib/Test/Simple/t/undef.t 2007-12-18 11:47:07.000000000 +0100 -+++ perl-5.10.0/lib/Test/Simple/t/undef.t 2009-02-17 17:16:41.000000000 +0100 -@@ -1,4 +1,5 @@ - #!/usr/bin/perl -w -+# $Id$ - - BEGIN { - if( $ENV{PERL_CORE} ) { -@@ -11,7 +12,7 @@ ++++ perl-5.10.0/lib/Test/Simple/t/undef.t 2009-08-26 06:14:11.000000000 +0200 +@@ -11,8 +11,7 @@ } use strict; -use Test::More tests => 18; -+use Test::More tests => 20; - use TieOut; +-use TieOut; ++use Test::More tests => 21; BEGIN { $^W = 1; } -@@ -31,7 +32,7 @@ + +@@ -31,7 +30,7 @@ } sub warnings_like { @@ -5769,7 +7583,7 @@ diff -urN perl-5.10.0.orig/lib/Test/Simple/t/undef.t perl-5.10.0/lib/Test/Simple $warnings = ''; } -@@ -48,9 +49,12 @@ +@@ -48,9 +47,12 @@ isnt( undef, '', 'undef isnt an empty string' ); isnt( undef, 0, 'undef isnt zero' ); @@ -5777,13 +7591,14 @@ diff -urN perl-5.10.0.orig/lib/Test/Simple/t/undef.t perl-5.10.0/lib/Test/Simple +Test::More->builder->isnt_num(23, undef, 'isnt_num()'); + #line 45 - like( undef, '/.*/', 'undef is like anything' ); +-like( undef, '/.*/', 'undef is like anything' ); -warnings_like("Use of uninitialized value.* at $Filename line 45\\.\n"); ++like( undef, qr/.*/, 'undef is like anything' ); +warnings_like(qr/Use of uninitialized value.* at $Filename line 45\.\n/); eq_array( [undef, undef], [undef, 23] ); no_warnings; -@@ -70,7 +74,7 @@ +@@ -70,23 +72,27 @@ #line 64 cmp_ok( undef, '<=', 2, ' undef <= 2' ); @@ -5792,13 +7607,37 @@ diff -urN perl-5.10.0.orig/lib/Test/Simple/t/undef.t perl-5.10.0/lib/Test/Simple + my $tb = Test::More->builder; + +-use TieOut; +-my $caught = tie *CATCH, 'TieOut'; +-my $old_fail = $tb->failure_output; +-$tb->failure_output(\*CATCH); ++my $err; ++$tb->failure_output(\$err); + diag(undef); +-$tb->failure_output($old_fail); ++$tb->reset_outputs; + +-is( $caught->read, "# undef\n" ); ++is( $err, "# undef\n" ); + no_warnings; + + + $tb->maybe_regex(undef); +-is( $caught->read, '' ); + no_warnings; ++ ++ ++# test-more.googlecode.com #42 ++{ ++ is_deeply([ undef ], [ undef ]); ++ no_warnings; ++} diff -urN perl-5.10.0.orig/lib/Test/Simple/t/use_ok.t perl-5.10.0/lib/Test/Simple/t/use_ok.t --- perl-5.10.0.orig/lib/Test/Simple/t/use_ok.t 2007-12-18 11:47:07.000000000 +0100 -+++ perl-5.10.0/lib/Test/Simple/t/use_ok.t 2009-02-17 17:16:41.000000000 +0100 -@@ -1,16 +1,17 @@ - #!/usr/bin/perl -w -+# $Id$ - ++++ perl-5.10.0/lib/Test/Simple/t/use_ok.t 2009-08-26 06:16:36.000000000 +0200 +@@ -3,14 +3,14 @@ BEGIN { if( $ENV{PERL_CORE} ) { chdir 't'; @@ -5815,7 +7654,7 @@ diff -urN perl-5.10.0.orig/lib/Test/Simple/t/use_ok.t perl-5.10.0/lib/Test/Simpl # Using Symbol because it's core and exports lots of stuff. { -@@ -58,3 +59,10 @@ +@@ -58,3 +58,10 @@ }; ::use_ok("Test::More", 0.47); } @@ -5826,20 +7665,11 @@ diff -urN perl-5.10.0.orig/lib/Test/Simple/t/use_ok.t perl-5.10.0/lib/Test/Simpl + ::use_ok("SigDie"); + ::ok(defined $SIG{__DIE__}, ' SIG{__DIE__} preserved'); +} -diff -urN perl-5.10.0.orig/lib/Test/Simple/t/useing.t perl-5.10.0/lib/Test/Simple/t/useing.t ---- perl-5.10.0.orig/lib/Test/Simple/t/useing.t 2007-12-18 11:47:07.000000000 +0100 -+++ perl-5.10.0/lib/Test/Simple/t/useing.t 2009-02-17 17:16:41.000000000 +0100 -@@ -1,3 +1,4 @@ -+# $Id$ - BEGIN { - if( $ENV{PERL_CORE} ) { - chdir 't'; diff -urN perl-5.10.0.orig/lib/Test/Simple/t/utf8.t perl-5.10.0/lib/Test/Simple/t/utf8.t --- perl-5.10.0.orig/lib/Test/Simple/t/utf8.t 1970-01-01 01:00:00.000000000 +0100 -+++ perl-5.10.0/lib/Test/Simple/t/utf8.t 2009-02-17 17:16:41.000000000 +0100 -@@ -0,0 +1,70 @@ ++++ perl-5.10.0/lib/Test/Simple/t/utf8.t 2009-08-26 06:14:11.000000000 +0200 +@@ -0,0 +1,69 @@ +#!/usr/bin/perl -w -+# $Id$ + +BEGIN { + if( $ENV{PERL_CORE} ) { @@ -5908,12 +7738,35 @@ diff -urN perl-5.10.0.orig/lib/Test/Simple/t/utf8.t perl-5.10.0/lib/Test/Simple/ + is( $uni, $uni, "Testing $uni" ); + is_deeply( \@warnings, [] ); +} +diff -urN perl-5.10.0.orig/lib/Test/Simple/t/versions.t perl-5.10.0/lib/Test/Simple/t/versions.t +--- perl-5.10.0.orig/lib/Test/Simple/t/versions.t 1970-01-01 01:00:00.000000000 +0100 ++++ perl-5.10.0/lib/Test/Simple/t/versions.t 2009-08-26 06:14:11.000000000 +0200 +@@ -0,0 +1,21 @@ ++#!/usr/bin/perl -w ++ ++# Make sure all the modules have the same version ++# ++# TBT has its own version system. ++ ++use strict; ++use Test::More; ++ ++require Test::Builder; ++require Test::Builder::Module; ++require Test::Simple; ++ ++my $dist_version = $Test::More::VERSION; ++ ++like( $dist_version, qr/^ \d+ \. \d+ $/x ); ++is( $dist_version, $Test::Builder::VERSION, 'Test::Builder' ); ++is( $dist_version, $Test::Builder::Module::VERSION, 'TB::Module' ); ++is( $dist_version, $Test::Simple::VERSION, 'Test::Simple' ); ++ ++done_testing(4); diff -urN perl-5.10.0.orig/lib/Test/Simple.pm perl-5.10.0/lib/Test/Simple.pm --- perl-5.10.0.orig/lib/Test/Simple.pm 2007-12-18 11:47:07.000000000 +0100 -+++ perl-5.10.0/lib/Test/Simple.pm 2009-02-17 17:16:41.000000000 +0100 -@@ -1,19 +1,19 @@ - package Test::Simple; -+# $Id$ ++++ perl-5.10.0/lib/Test/Simple.pm 2009-08-26 06:14:11.000000000 +0200 +@@ -2,18 +2,17 @@ use 5.004; @@ -5923,7 +7776,7 @@ diff -urN perl-5.10.0.orig/lib/Test/Simple.pm perl-5.10.0/lib/Test/Simple.pm -$VERSION = eval $VERSION; # make the alpha version come out as a number +use strict; + -+our $VERSION = '0.86'; ++our $VERSION = '0.92'; +$VERSION = eval $VERSION; ## no critic (BuiltinFunctions::ProhibitStringyEval) use Test::Builder::Module; @@ -5938,7 +7791,7 @@ diff -urN perl-5.10.0.orig/lib/Test/Simple.pm perl-5.10.0/lib/Test/Simple.pm =head1 NAME Test::Simple - Basic utilities for writing tests. -@@ -77,11 +77,10 @@ +@@ -77,11 +76,10 @@ =cut @@ -5952,7 +7805,7 @@ diff -urN perl-5.10.0.orig/lib/Test/Simple.pm perl-5.10.0/lib/Test/Simple.pm =back Test::Simple will start by printing number of tests run in the form -@@ -191,24 +190,10 @@ +@@ -191,24 +189,10 @@ (i.e. you can just use Test::More instead of Test::Simple in your programs and things will still work). @@ -5979,7 +7832,7 @@ diff -urN perl-5.10.0.orig/lib/Test/Simple.pm perl-5.10.0/lib/Test/Simple.pm =head1 AUTHORS -@@ -218,7 +203,7 @@ +@@ -218,7 +202,7 @@ =head1 COPYRIGHT @@ -5988,36 +7841,221 @@ diff -urN perl-5.10.0.orig/lib/Test/Simple.pm perl-5.10.0/lib/Test/Simple.pm This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. -diff -urN perl-5.10.0.orig/lib/Test/Tutorial.pod perl-5.10.0/lib/Test/Tutorial.pod ---- perl-5.10.0.orig/lib/Test/Tutorial.pod 2007-12-18 11:47:07.000000000 +0100 -+++ perl-5.10.0/lib/Test/Tutorial.pod 2009-02-17 17:16:41.000000000 +0100 -@@ -1,3 +1,4 @@ -+# $Id$ - =head1 NAME - - Test::Tutorial - A tutorial about writing really basic tests -diff -urN perl-5.10.0.orig/t/lib/NoExporter.pm perl-5.10.0/t/lib/NoExporter.pm ---- perl-5.10.0.orig/t/lib/NoExporter.pm 2007-12-18 11:47:08.000000000 +0100 -+++ perl-5.10.0/t/lib/NoExporter.pm 2009-02-17 17:16:41.000000000 +0100 -@@ -1,7 +1,9 @@ - package NoExporter; -+# $Id$ - - $VERSION = 1.02; --sub import { +diff -urN perl-5.10.0.orig/MANIFEST perl-5.10.0/MANIFEST +--- perl-5.10.0.orig/MANIFEST 2007-12-18 11:47:07.000000000 +0100 ++++ perl-5.10.0/MANIFEST 2009-08-26 06:14:11.000000000 +0200 +@@ -2626,20 +2626,34 @@ + lib/Test/Simple/Changes Test::Simple changes + lib/Test/Simple.pm Basic utility for writing tests + lib/Test/Simple/README Test::Simple README ++lib/Test/Simple/TODO Test::Simple TODO + lib/Test/Simple/t/00test_harness_check.t Test::Simple test + lib/Test/Simple/t/bad_plan.t Test::Builder plan() test + lib/Test/Simple/t/bail_out.t Test::Builder BAIL_OUT test ++lib/Test/Simple/t/BEGIN_require_ok.t ++lib/Test/Simple/t/BEGIN_use_ok.t + lib/Test/Simple/t/buffer.t Test::Builder buffering test + lib/Test/Simple/t/Builder.t Test::Builder tests ++lib/Test/Simple/t/c_flag.t + lib/Test/Simple/t/carp.t Test::Builder test + lib/Test/Simple/t/circular_data.t Test::Simple test + lib/Test/Simple/t/cmp_ok.t Test::More test + lib/Test/Simple/t/create.t Test::Simple test +-lib/Test/Simple/t/curr_test.t Test::Builder->curr_test tests ++lib/Test/Simple/t/current_test.t ++lib/Test/Simple/t/current_test_without_plan.t + lib/Test/Simple/t/details.t Test::Builder tests + lib/Test/Simple/t/diag.t Test::More diag() test ++lib/Test/Simple/t/died.t ++lib/Test/Simple/t/done_testing_double.t ++lib/Test/Simple/t/done_testing_plan_mismatch.t ++lib/Test/Simple/t/done_testing.t ++lib/Test/Simple/t/done_testing_with_no_plan.t ++lib/Test/Simple/t/done_testing_with_number.t ++lib/Test/Simple/t/done_testing_with_plan.t ++lib/Test/Simple/t/dont_overwrite_die_handler.t + lib/Test/Simple/t/eq_set.t Test::Simple test + lib/Test/Simple/t/exit.t Test::Simple test, exit codes ++lib/Test/Simple/t/explain.t + lib/Test/Simple/t/extra_one.t Test::Simple test + lib/Test/Simple/t/extra.t Test::Simple test + lib/Test/Simple/t/fail-like.t Test::More test, like() failures +@@ -2648,6 +2662,7 @@ + lib/Test/Simple/t/fail.t Test::Simple test, test failures + lib/Test/Simple/t/filehandles.t Test::Simple test, STDOUT can be played with + lib/Test/Simple/t/fork.t Test::More fork tests ++lib/Test/Simple/t/fork_with_new_stdout.t + lib/Test/Simple/t/harness_active.t Test::Simple test + lib/Test/Simple/t/has_plan2.t Test::More->plan tests + lib/Test/Simple/t/has_plan.t Test::Builder->plan tests +@@ -2661,10 +2676,15 @@ + lib/Test/Simple/t/maybe_regex.t Test::Builder->maybe_regex() tests + lib/Test/Simple/t/missing.t Test::Simple test, missing tests + lib/Test/Simple/t/More.t Test::More test, basic stuff ++lib/Test/Simple/t/new_ok.t + lib/Test/Simple/t/no_diag.t Test::Simple test + lib/Test/Simple/t/no_ending.t Test::Builder test, no_ending() + lib/Test/Simple/t/no_header.t Test::Builder test, no_header() + lib/Test/Simple/t/no_plan.t Test::Simple test, forgot the plan ++lib/Test/Simple/t/no_plan_at_all.t ++lib/Test/Simple/t/no_tests.t ++lib/Test/Simple/t/note.t ++lib/Test/Simple/t/reset_outputs.t + lib/Test/Simple/TODO Test::Simple TODO + lib/Test/Simple/t/ok_obj.t Test::Builder object tests + lib/Test/Simple/t/output.t Test::Builder test, output methods +@@ -2681,6 +2701,7 @@ + lib/Test/Simple/t/simple.t Test::Simple test, basic stuff + lib/Test/Simple/t/skipall.t Test::More test, skip all tests + lib/Test/Simple/t/skip.t Test::More test, SKIP tests ++lib/Test/Simple/t/tbm_doesnt_set_exported_to.t + lib/Test/Simple/t/tbt_01basic.t Test::Builder::Tester test + lib/Test/Simple/t/tbt_02fhrestore.t Test::Builder::Tester test + lib/Test/Simple/t/tbt_03die.t Test::Builder::Tester test +@@ -2695,6 +2716,8 @@ + lib/Test/Simple/t/undef.t Test::More test, undefs don't cause warnings + lib/Test/Simple/t/useing.t Test::More test, compile test + lib/Test/Simple/t/use_ok.t Test::More test, use_ok() ++lib/Test/Simple/t/utf8.t ++lib/Test/Simple/t/versions.t + lib/Test/t/05_about_verbose.t See if Test works + lib/Test/t/fail.t See if Test works + lib/Test/t/mix.t See if Test works +diff -urN perl-5.10.0.orig/t/lib/Test/Builder/NoOutput.pm perl-5.10.0/t/lib/Test/Builder/NoOutput.pm +--- perl-5.10.0.orig/t/lib/Test/Builder/NoOutput.pm 1970-01-01 01:00:00.000000000 +0100 ++++ perl-5.10.0/t/lib/Test/Builder/NoOutput.pm 2009-08-26 06:14:11.000000000 +0200 +@@ -0,0 +1,122 @@ ++package Test::Builder::NoOutput; + -+sub import { - shift; - die "NoExporter exports nothing. You asked for: @_" if @_; - } ++use strict; ++use warnings; ++ ++use base qw(Test::Builder); ++ ++ ++=head1 NAME ++ ++Test::Builder::NoOutput - A subclass of Test::Builder which prints nothing ++ ++=head1 SYNOPSIS ++ ++ use Test::Builder::NoOutput; ++ ++ my $tb = Test::Builder::NoOutput->new; ++ ++ ...test as normal... ++ ++ my $output = $tb->read; ++ ++=head1 DESCRIPTION ++ ++This is a subclass of Test::Builder which traps all its output. ++It is mostly useful for testing Test::Builder. ++ ++=head3 read ++ ++ my $all_output = $tb->read; ++ my $output = $tb->read($stream); ++ ++Returns all the output (including failure and todo output) collected ++so far. It is destructive, each call to read clears the output ++buffer. ++ ++If $stream is given it will return just the output from that stream. ++$stream's are... ++ ++ out output() ++ err failure_output() ++ todo todo_output() ++ all all outputs ++ ++Defaults to 'all'. ++ ++=cut ++ ++my $Test = __PACKAGE__->new; ++ ++sub create { ++ my $class = shift; ++ my $self = $class->SUPER::create(@_); ++ ++ my %outputs = ( ++ all => '', ++ out => '', ++ err => '', ++ todo => '', ++ ); ++ $self->{_outputs} = \%outputs; ++ ++ tie *OUT, "Test::Builder::NoOutput::Tee", \$outputs{all}, \$outputs{out}; ++ tie *ERR, "Test::Builder::NoOutput::Tee", \$outputs{all}, \$outputs{err}; ++ tie *TODO, "Test::Builder::NoOutput::Tee", \$outputs{all}, \$outputs{todo}; ++ ++ $self->output(*OUT); ++ $self->failure_output(*ERR); ++ $self->todo_output(*TODO); ++ ++ return $self; ++} ++ ++sub read { ++ my $self = shift; ++ my $stream = @_ ? shift : 'all'; ++ ++ my $out = $self->{_outputs}{$stream}; ++ ++ $self->{_outputs}{$stream} = ''; ++ ++ # Clear all the streams if 'all' is read. ++ if( $stream eq 'all' ) { ++ my @keys = keys %{$self->{_outputs}}; ++ $self->{_outputs}{$_} = '' for @keys; ++ } ++ ++ return $out; ++} ++ ++ ++package Test::Builder::NoOutput::Tee; ++ ++# A cheap implementation of IO::Tee. ++ ++sub TIEHANDLE { ++ my($class, @refs) = @_; ++ ++ my @fhs; ++ for my $ref (@refs) { ++ my $fh = Test::Builder->_new_fh($ref); ++ push @fhs, $fh; ++ } ++ ++ my $self = [@fhs]; ++ return bless $self, $class; ++} ++ ++sub PRINT { ++ my $self = shift; ++ ++ print $_ @_ for @$self; ++} ++ ++sub PRINTF { ++ my $self = shift; ++ my $format = shift; ++ ++ printf $_ @_ for @$self; ++} ++ ++1; diff -urN perl-5.10.0.orig/t/lib/Test/Simple/Catch.pm perl-5.10.0/t/lib/Test/Simple/Catch.pm --- perl-5.10.0.orig/t/lib/Test/Simple/Catch.pm 2007-12-18 11:47:08.000000000 +0100 -+++ perl-5.10.0/t/lib/Test/Simple/Catch.pm 2009-02-17 17:16:41.000000000 +0100 -@@ -1,9 +1,10 @@ ++++ perl-5.10.0/t/lib/Test/Simple/Catch.pm 2009-08-26 06:14:11.000000000 +0200 +@@ -1,9 +1,11 @@ # For testing Test::Simple; -+# $Id$ package Test::Simple::Catch; ++use strict; ++ use Symbol; use TieOut; -my($out_fh, $err_fh) = (gensym, gensym); @@ -6025,7 +8063,7 @@ diff -urN perl-5.10.0.orig/t/lib/Test/Simple/Catch.pm perl-5.10.0/t/lib/Test/Sim my $out = tie *$out_fh, 'TieOut'; my $err = tie *$err_fh, 'TieOut'; -@@ -13,6 +14,6 @@ +@@ -13,6 +15,6 @@ $t->failure_output($err_fh); $t->todo_output($err_fh); @@ -6035,12 +8073,8 @@ diff -urN perl-5.10.0.orig/t/lib/Test/Simple/Catch.pm perl-5.10.0/t/lib/Test/Sim 1; diff -urN perl-5.10.0.orig/t/lib/Test/Simple/sample_tests/death.plx perl-5.10.0/t/lib/Test/Simple/sample_tests/death.plx --- perl-5.10.0.orig/t/lib/Test/Simple/sample_tests/death.plx 2007-12-18 11:47:08.000000000 +0100 -+++ perl-5.10.0/t/lib/Test/Simple/sample_tests/death.plx 2009-02-17 17:16:41.000000000 +0100 -@@ -1,13 +1,16 @@ - require Test::Simple; -+# $Id$ - - push @INC, 't/lib'; ++++ perl-5.10.0/t/lib/Test/Simple/sample_tests/death.plx 2009-08-26 06:14:11.000000000 +0200 +@@ -4,10 +4,13 @@ require Test::Simple::Catch; my($out, $err) = Test::Simple::Catch::caught(); @@ -6054,22 +8088,13 @@ diff -urN perl-5.10.0.orig/t/lib/Test/Simple/sample_tests/death.plx perl-5.10.0/ ok(1); ok(1); -die "Knife?"; ++$! = 0; +die "This is a test"; -diff -urN perl-5.10.0.orig/t/lib/Test/Simple/sample_tests/death_in_eval.plx perl-5.10.0/t/lib/Test/Simple/sample_tests/death_in_eval.plx ---- perl-5.10.0.orig/t/lib/Test/Simple/sample_tests/death_in_eval.plx 2007-12-18 11:47:08.000000000 +0100 -+++ perl-5.10.0/t/lib/Test/Simple/sample_tests/death_in_eval.plx 2009-02-17 17:16:41.000000000 +0100 -@@ -1,4 +1,5 @@ - require Test::Simple; -+# $Id$ - use Carp; - - push @INC, 't/lib'; diff -urN perl-5.10.0.orig/t/lib/Test/Simple/sample_tests/death_with_handler.plx perl-5.10.0/t/lib/Test/Simple/sample_tests/death_with_handler.plx --- perl-5.10.0.orig/t/lib/Test/Simple/sample_tests/death_with_handler.plx 1970-01-01 01:00:00.000000000 +0100 -+++ perl-5.10.0/t/lib/Test/Simple/sample_tests/death_with_handler.plx 2009-02-17 17:16:41.000000000 +0100 -@@ -0,0 +1,19 @@ ++++ perl-5.10.0/t/lib/Test/Simple/sample_tests/death_with_handler.plx 2009-08-26 06:14:11.000000000 +0200 +@@ -0,0 +1,20 @@ +require Test::Simple; -+# $Id$ + +push @INC, 't/lib'; +require Test::Simple::Catch; @@ -6086,42 +8111,13 @@ diff -urN perl-5.10.0.orig/t/lib/Test/Simple/sample_tests/death_with_handler.plx + +ok(1); +ok(1); ++ ++$! = 0; +die "This is a test"; -diff -urN perl-5.10.0.orig/t/lib/Test/Simple/sample_tests/exit.plx perl-5.10.0/t/lib/Test/Simple/sample_tests/exit.plx ---- perl-5.10.0.orig/t/lib/Test/Simple/sample_tests/exit.plx 2007-12-18 11:47:08.000000000 +0100 -+++ perl-5.10.0/t/lib/Test/Simple/sample_tests/exit.plx 2009-02-17 17:16:41.000000000 +0100 -@@ -1,3 +1,4 @@ - require Test::Builder; -+# $Id$ - - exit 1; -diff -urN perl-5.10.0.orig/t/lib/Test/Simple/sample_tests/extras.plx perl-5.10.0/t/lib/Test/Simple/sample_tests/extras.plx ---- perl-5.10.0.orig/t/lib/Test/Simple/sample_tests/extras.plx 2007-12-18 11:47:08.000000000 +0100 -+++ perl-5.10.0/t/lib/Test/Simple/sample_tests/extras.plx 2009-02-17 17:16:41.000000000 +0100 -@@ -1,4 +1,5 @@ - require Test::Simple; -+# $Id$ - - push @INC, 't/lib'; - require Test::Simple::Catch; -diff -urN perl-5.10.0.orig/t/lib/Test/Simple/sample_tests/five_fail.plx perl-5.10.0/t/lib/Test/Simple/sample_tests/five_fail.plx ---- perl-5.10.0.orig/t/lib/Test/Simple/sample_tests/five_fail.plx 2007-12-18 11:47:08.000000000 +0100 -+++ perl-5.10.0/t/lib/Test/Simple/sample_tests/five_fail.plx 2009-02-17 17:16:41.000000000 +0100 -@@ -1,4 +1,5 @@ - require Test::Simple; -+# $Id$ - - use lib 't/lib'; - require Test::Simple::Catch; diff -urN perl-5.10.0.orig/t/lib/Test/Simple/sample_tests/last_minute_death.plx perl-5.10.0/t/lib/Test/Simple/sample_tests/last_minute_death.plx --- perl-5.10.0.orig/t/lib/Test/Simple/sample_tests/last_minute_death.plx 2007-12-18 11:47:08.000000000 +0100 -+++ perl-5.10.0/t/lib/Test/Simple/sample_tests/last_minute_death.plx 2009-02-17 17:16:41.000000000 +0100 -@@ -1,11 +1,14 @@ - require Test::Simple; -+# $Id$ - - push @INC, 't/lib'; - require Test::Simple::Catch; ++++ perl-5.10.0/t/lib/Test/Simple/sample_tests/last_minute_death.plx 2009-08-26 06:14:11.000000000 +0200 +@@ -5,7 +5,9 @@ my($out, $err) = Test::Simple::Catch::caught(); Test::Simple->import(tests => 5); @@ -6132,86 +8128,31 @@ diff -urN perl-5.10.0.orig/t/lib/Test/Simple/sample_tests/last_minute_death.plx ok(1); ok(1); -@@ -13,4 +16,4 @@ +@@ -13,4 +15,5 @@ ok(1); ok(1); -die "Almost there..."; ++$! = 0; +die "This is a test"; -diff -urN perl-5.10.0.orig/t/lib/Test/Simple/sample_tests/one_fail.plx perl-5.10.0/t/lib/Test/Simple/sample_tests/one_fail.plx ---- perl-5.10.0.orig/t/lib/Test/Simple/sample_tests/one_fail.plx 2007-12-18 11:47:08.000000000 +0100 -+++ perl-5.10.0/t/lib/Test/Simple/sample_tests/one_fail.plx 2009-02-17 17:16:41.000000000 +0100 -@@ -1,4 +1,5 @@ - require Test::Simple; -+# $Id$ - - push @INC, 't/lib'; - require Test::Simple::Catch; -diff -urN perl-5.10.0.orig/t/lib/Test/Simple/sample_tests/pre_plan_death.plx perl-5.10.0/t/lib/Test/Simple/sample_tests/pre_plan_death.plx ---- perl-5.10.0.orig/t/lib/Test/Simple/sample_tests/pre_plan_death.plx 2007-12-18 11:47:08.000000000 +0100 -+++ perl-5.10.0/t/lib/Test/Simple/sample_tests/pre_plan_death.plx 2009-02-17 17:16:41.000000000 +0100 -@@ -1,4 +1,5 @@ - # ID 20020716.013, the exit code would become 0 if the test died -+# $Id$ - # before a plan. - - require Test::Simple; -diff -urN perl-5.10.0.orig/t/lib/Test/Simple/sample_tests/require.plx perl-5.10.0/t/lib/Test/Simple/sample_tests/require.plx ---- perl-5.10.0.orig/t/lib/Test/Simple/sample_tests/require.plx 2007-12-18 11:47:08.000000000 +0100 -+++ perl-5.10.0/t/lib/Test/Simple/sample_tests/require.plx 2009-02-17 17:16:41.000000000 +0100 -@@ -1 +1,2 @@ - require Test::Simple; -+# $Id$ -diff -urN perl-5.10.0.orig/t/lib/Test/Simple/sample_tests/success.plx perl-5.10.0/t/lib/Test/Simple/sample_tests/success.plx ---- perl-5.10.0.orig/t/lib/Test/Simple/sample_tests/success.plx 2007-12-18 11:47:08.000000000 +0100 -+++ perl-5.10.0/t/lib/Test/Simple/sample_tests/success.plx 2009-02-17 17:16:41.000000000 +0100 -@@ -1,4 +1,5 @@ - require Test::Simple; -+# $Id$ - - push @INC, 't/lib'; - require Test::Simple::Catch; -diff -urN perl-5.10.0.orig/t/lib/Test/Simple/sample_tests/too_few.plx perl-5.10.0/t/lib/Test/Simple/sample_tests/too_few.plx ---- perl-5.10.0.orig/t/lib/Test/Simple/sample_tests/too_few.plx 2007-12-18 11:47:08.000000000 +0100 -+++ perl-5.10.0/t/lib/Test/Simple/sample_tests/too_few.plx 2009-02-17 17:16:41.000000000 +0100 -@@ -1,4 +1,5 @@ - require Test::Simple; -+# $Id$ - - push @INC, 't/lib'; - require Test::Simple::Catch; diff -urN perl-5.10.0.orig/t/lib/Test/Simple/sample_tests/too_few_fail.plx perl-5.10.0/t/lib/Test/Simple/sample_tests/too_few_fail.plx --- perl-5.10.0.orig/t/lib/Test/Simple/sample_tests/too_few_fail.plx 2007-12-18 11:47:08.000000000 +0100 -+++ perl-5.10.0/t/lib/Test/Simple/sample_tests/too_few_fail.plx 2009-02-17 17:16:41.000000000 +0100 -@@ -1,4 +1,5 @@ - require Test::Simple; -+# $Id$ - - push @INC, 't/lib'; - require Test::Simple::Catch; -@@ -9,4 +10,4 @@ ++++ perl-5.10.0/t/lib/Test/Simple/sample_tests/too_few_fail.plx 2009-08-26 06:14:11.000000000 +0200 +@@ -9,4 +9,4 @@ ok(0); ok(1); -ok(0); \ No newline at end of file +ok(0); -diff -urN perl-5.10.0.orig/t/lib/Test/Simple/sample_tests/two_fail.plx perl-5.10.0/t/lib/Test/Simple/sample_tests/two_fail.plx ---- perl-5.10.0.orig/t/lib/Test/Simple/sample_tests/two_fail.plx 2007-12-18 11:47:08.000000000 +0100 -+++ perl-5.10.0/t/lib/Test/Simple/sample_tests/two_fail.plx 2009-02-17 17:16:41.000000000 +0100 -@@ -1,4 +1,5 @@ - require Test::Simple; -+# $Id$ - - push @INC, 't/lib'; - require Test::Simple::Catch; diff -urN perl-5.10.0.orig/t/lib/TieOut.pm perl-5.10.0/t/lib/TieOut.pm --- perl-5.10.0.orig/t/lib/TieOut.pm 2007-12-18 11:47:08.000000000 +0100 -+++ perl-5.10.0/t/lib/TieOut.pm 2009-02-17 17:16:41.000000000 +0100 -@@ -1,13 +1,14 @@ ++++ perl-5.10.0/t/lib/TieOut.pm 2009-08-26 06:14:11.000000000 +0200 +@@ -1,13 +1,15 @@ package TieOut; -+# $Id$ ++use strict; ++ sub TIEHANDLE { my $scalar = ''; - bless( \$scalar, $_[0]); @@ -6225,7 +8166,7 @@ diff -urN perl-5.10.0.orig/t/lib/TieOut.pm perl-5.10.0/t/lib/TieOut.pm } sub PRINTF { -@@ -16,7 +17,7 @@ +@@ -16,7 +18,7 @@ $$self .= sprintf $fmt, @_; } diff --git a/perl.spec b/perl.spec index 7acd6d5..cd33911 100644 --- a/perl.spec +++ b/perl.spec @@ -7,7 +7,7 @@ Name: perl Version: %{perl_version} -Release: 81%{?dist} +Release: 82%{?dist} Epoch: %{perl_epoch} Summary: Practical Extraction and Report Language Group: Development/Languages @@ -235,7 +235,7 @@ Patch113: perl-update-Sys-Syslog.patch Patch114: perl-update-Test-Harness.patch %define Test_Harness_version 3.16 Patch115: perl-update-Test-Simple.patch -%define Test_Simple_version 0.86 +%define Test_Simple_version 0.92 Patch116: perl-update-Time-HiRes.patch %define Time_HiRes_version 1.9719 Patch117: perl-update-Digest-SHA.patch @@ -250,6 +250,8 @@ Patch120: perl-update-Compress_Raw_Zlib.patch %define Compress_Raw_Zlib 2.020 Patch121: perl-update-Scalar-List-Utils.patch %define Scalar_List_Utils 1.21 +Patch122: perl-update-Module-Pluggable.patch +%define Module_Pluggable_version 3.90 # Fedora uses links instead of lynx # patches File-Fetch and CPAN @@ -772,7 +774,7 @@ Group: Development/Libraries License: GPL+ or Artistic # Epoch bump for clean upgrade over old standalone package Epoch: 1 -Version: 3.60 +Version: %{Module_Pluggable_version} Requires: perl = %{perl_epoch}:%{perl_version}-%{release} %description Module-Pluggable @@ -1032,6 +1034,12 @@ upstream tarball from perl.org. %patch119 -p1 %patch120 -p1 %patch121 -p1 +%patch122 -p1 +# 0-byte files and patch don't seem to agree +mkdir t/Module_Pluggable/lib/Zot/ +touch t/Module_Pluggable/lib/Zot/.Zork.pm + + %patch201 -p1 # @@ -1313,6 +1321,7 @@ perl -x patchlevel.h \ 'Fedora Patch119: Update File::Spec to %{File_Spec_version}' \ 'Fedora Patch120: Update Compress::Raw::Zlib to %{Compress_Raw_Zlib}' \ 'Fedora Patch121: Update Scalar-List-Utils to %{Scalar_List_Utils}' \ + 'Fedora Patch122: Update Module-Pluggable to %{Module_Pluggable_version}' \ 'Fedora Patch201: Fedora uses links instead of lynx' \ %{nil} @@ -1939,6 +1948,10 @@ TMPDIR="$PWD/tmp" make test # Old changelog entries are preserved in CVS. %changelog +* Mon Aug 31 2009 Chris Weyl - 4:5.10.0-82 +- update our Test-Simple update to 0.92 (patch by Iain Arnell), #519417 +- update Module-Pluggable to 3.9 + * Thu Aug 27 2009 Chris Weyl - 4:5.10.0-81 - fix macros.perl *sigh*