Permalink
Browse files

r38346@windhund: schwern | 2007-09-19 23:09:34 -0400

     Bug unfixes
     * The BEGIN { use_ok } fix for [rt.cpan.org 28345] revealed a small pile of 
       mistakes in CPAN module test suites.  Rolling the fix back to give the authors
       a bit of time to fix their tests.
  • Loading branch information...
1 parent 221b57a commit 1cec3dc32c233b39b3406a97f10f1d4bb1f4180d @schwern schwern committed Oct 14, 2007
Showing with 22 additions and 50 deletions.
  1. +6 −0 Changes
  2. +0 −1 MANIFEST
  3. +1 −1 lib/Test/Builder.pm
  4. +1 −1 lib/Test/Builder/Module.pm
  5. +1 −1 lib/Test/Builder/Tester.pm
  6. +12 −17 lib/Test/More.pm
  7. +1 −1 lib/Test/Simple.pm
  8. +0 −28 t/BEGIN_use_ok.t
View
@@ -1,3 +1,9 @@
+0.72 Wed Sep 19 20:08:07 PDT 2007
+ Bug unfixes
+ * The BEGIN { use_ok } fix for [rt.cpan.org 28345] revealed a small pile of
+ mistakes in CPAN module test suites. Rolling the fix back to give the authors
+ a bit of time to fix their tests.
+
0.71 Thu Sep 13 20:42:36 PDT 2007
Bug fixes
- Fixed a problem with BEGIN { use_ok } silently failing when there's no
View
@@ -13,7 +13,6 @@ t/00signature.t
t/00test_harness_check.t
t/bad_plan.t
t/bail_out.t
-t/BEGIN_use_ok.t
t/buffer.t
t/Builder.t
t/carp.t
View
@@ -8,7 +8,7 @@ $^C ||= 0;
use strict;
use vars qw($VERSION);
-$VERSION = '0.71';
+$VERSION = '0.72';
$VERSION = eval $VERSION; # make the alpha version come out as a number
# Make Test::Builder thread-safe for ithreads.
@@ -5,7 +5,7 @@ use Test::Builder;
require Exporter;
@ISA = qw(Exporter);
-$VERSION = '0.71';
+$VERSION = '0.72';
use strict;
@@ -2,7 +2,7 @@ package Test::Builder::Tester;
use strict;
use vars qw(@EXPORT $VERSION @ISA);
-$VERSION = "1.08";
+$VERSION = "1.09";
use Test::Builder;
use Symbol;
View
@@ -16,7 +16,7 @@ sub _carp {
use vars qw($VERSION @ISA @EXPORT %EXPORT_TAGS $TODO);
-$VERSION = '0.71';
+$VERSION = '0.72';
$VERSION = eval $VERSION; # make the alpha version come out as a number
use Test::Builder::Module;
@@ -659,37 +659,32 @@ sub use_ok ($;@) {
my($pack,$filename,$line) = caller;
- # Work around a glitch in $@ and eval
- my $eval_error;
- {
- local($@,$!,$SIG{__DIE__}); # isolate eval
+ local($@,$!,$SIG{__DIE__}); # isolate eval
- if( @imports == 1 and $imports[0] =~ /^\d+(?:\.\d+)?$/ ) {
- # probably a version check. Perl needs to see the bare number
- # for it to work with non-Exporter based modules.
- eval <<USE;
+ if( @imports == 1 and $imports[0] =~ /^\d+(?:\.\d+)?$/ ) {
+ # probably a version check. Perl needs to see the bare number
+ # for it to work with non-Exporter based modules.
+ eval <<USE;
package $pack;
use $module $imports[0];
USE
- }
- else {
- eval <<USE;
+ }
+ else {
+ eval <<USE;
package $pack;
use $module \@imports;
USE
- }
- $eval_error = $@;
}
- my $ok = $tb->ok( !$eval_error, "use $module;" );
+ my $ok = $tb->ok( !$@, "use $module;" );
unless( $ok ) {
- chomp $eval_error;
+ chomp $@;
$@ =~ s{^BEGIN failed--compilation aborted at .*$}
{BEGIN failed--compilation aborted at $filename line $line.}m;
$tb->diag(<<DIAGNOSTIC);
Tried to use '$module'.
- Error: $eval_error
+ Error: $@
DIAGNOSTIC
}
View
@@ -4,7 +4,7 @@ use 5.004;
use strict 'vars';
use vars qw($VERSION @ISA @EXPORT);
-$VERSION = '0.71';
+$VERSION = '0.72';
$VERSION = eval $VERSION; # make the alpha version come out as a number
use Test::Builder::Module;
View
@@ -1,28 +0,0 @@
-#!/usr/bin/perl -w
-
-# [rt.cpan.org 28345]
-#
-# A use_ok() inside a BEGIN block lacking a plan would be silently ignored.
-
-BEGIN {
- if( $ENV{PERL_CORE} ) {
- chdir 't';
- @INC = ('../lib', 'lib');
- }
- else {
- unshift @INC, 't/lib';
- }
-}
-
-use Test::More;
-
-my $result;
-BEGIN {
- eval {
- use_ok("Wibble");
- };
- $result = $@;
-}
-
-plan tests => 1;
-like $result, '/^You tried to run a test without a plan/';

0 comments on commit 1cec3dc

Please sign in to comment.