Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

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...
commit 1cec3dc32c233b39b3406a97f10f1d4bb1f4180d 1 parent 221b57a
Michael G. Schwern schwern authored
6 Changes
... ... @@ -1,3 +1,9 @@
  1 +0.72 Wed Sep 19 20:08:07 PDT 2007
  2 + Bug unfixes
  3 + * The BEGIN { use_ok } fix for [rt.cpan.org 28345] revealed a small pile of
  4 + mistakes in CPAN module test suites. Rolling the fix back to give the authors
  5 + a bit of time to fix their tests.
  6 +
1 7 0.71 Thu Sep 13 20:42:36 PDT 2007
2 8 Bug fixes
3 9 - Fixed a problem with BEGIN { use_ok } silently failing when there's no
1  MANIFEST
@@ -13,7 +13,6 @@ t/00signature.t
13 13 t/00test_harness_check.t
14 14 t/bad_plan.t
15 15 t/bail_out.t
16   -t/BEGIN_use_ok.t
17 16 t/buffer.t
18 17 t/Builder.t
19 18 t/carp.t
2  lib/Test/Builder.pm
@@ -8,7 +8,7 @@ $^C ||= 0;
8 8
9 9 use strict;
10 10 use vars qw($VERSION);
11   -$VERSION = '0.71';
  11 +$VERSION = '0.72';
12 12 $VERSION = eval $VERSION; # make the alpha version come out as a number
13 13
14 14 # Make Test::Builder thread-safe for ithreads.
2  lib/Test/Builder/Module.pm
@@ -5,7 +5,7 @@ use Test::Builder;
5 5 require Exporter;
6 6 @ISA = qw(Exporter);
7 7
8   -$VERSION = '0.71';
  8 +$VERSION = '0.72';
9 9
10 10 use strict;
11 11
2  lib/Test/Builder/Tester.pm
@@ -2,7 +2,7 @@ package Test::Builder::Tester;
2 2
3 3 use strict;
4 4 use vars qw(@EXPORT $VERSION @ISA);
5   -$VERSION = "1.08";
  5 +$VERSION = "1.09";
6 6
7 7 use Test::Builder;
8 8 use Symbol;
29 lib/Test/More.pm
@@ -16,7 +16,7 @@ sub _carp {
16 16
17 17
18 18 use vars qw($VERSION @ISA @EXPORT %EXPORT_TAGS $TODO);
19   -$VERSION = '0.71';
  19 +$VERSION = '0.72';
20 20 $VERSION = eval $VERSION; # make the alpha version come out as a number
21 21
22 22 use Test::Builder::Module;
@@ -659,37 +659,32 @@ sub use_ok ($;@) {
659 659
660 660 my($pack,$filename,$line) = caller;
661 661
662   - # Work around a glitch in $@ and eval
663   - my $eval_error;
664   - {
665   - local($@,$!,$SIG{__DIE__}); # isolate eval
  662 + local($@,$!,$SIG{__DIE__}); # isolate eval
666 663
667   - if( @imports == 1 and $imports[0] =~ /^\d+(?:\.\d+)?$/ ) {
668   - # probably a version check. Perl needs to see the bare number
669   - # for it to work with non-Exporter based modules.
670   - eval <<USE;
  664 + if( @imports == 1 and $imports[0] =~ /^\d+(?:\.\d+)?$/ ) {
  665 + # probably a version check. Perl needs to see the bare number
  666 + # for it to work with non-Exporter based modules.
  667 + eval <<USE;
671 668 package $pack;
672 669 use $module $imports[0];
673 670 USE
674   - }
675   - else {
676   - eval <<USE;
  671 + }
  672 + else {
  673 + eval <<USE;
677 674 package $pack;
678 675 use $module \@imports;
679 676 USE
680   - }
681   - $eval_error = $@;
682 677 }
683 678
684   - my $ok = $tb->ok( !$eval_error, "use $module;" );
  679 + my $ok = $tb->ok( !$@, "use $module;" );
685 680
686 681 unless( $ok ) {
687   - chomp $eval_error;
  682 + chomp $@;
688 683 $@ =~ s{^BEGIN failed--compilation aborted at .*$}
689 684 {BEGIN failed--compilation aborted at $filename line $line.}m;
690 685 $tb->diag(<<DIAGNOSTIC);
691 686 Tried to use '$module'.
692   - Error: $eval_error
  687 + Error: $@
693 688 DIAGNOSTIC
694 689
695 690 }
2  lib/Test/Simple.pm
@@ -4,7 +4,7 @@ use 5.004;
4 4
5 5 use strict 'vars';
6 6 use vars qw($VERSION @ISA @EXPORT);
7   -$VERSION = '0.71';
  7 +$VERSION = '0.72';
8 8 $VERSION = eval $VERSION; # make the alpha version come out as a number
9 9
10 10 use Test::Builder::Module;
28 t/BEGIN_use_ok.t
... ... @@ -1,28 +0,0 @@
1   -#!/usr/bin/perl -w
2   -
3   -# [rt.cpan.org 28345]
4   -#
5   -# A use_ok() inside a BEGIN block lacking a plan would be silently ignored.
6   -
7   -BEGIN {
8   - if( $ENV{PERL_CORE} ) {
9   - chdir 't';
10   - @INC = ('../lib', 'lib');
11   - }
12   - else {
13   - unshift @INC, 't/lib';
14   - }
15   -}
16   -
17   -use Test::More;
18   -
19   -my $result;
20   -BEGIN {
21   - eval {
22   - use_ok("Wibble");
23   - };
24   - $result = $@;
25   -}
26   -
27   -plan tests => 1;
28   -like $result, '/^You tried to run a test without a plan/';

0 comments on commit 1cec3dc

Please sign in to comment.
Something went wrong with that request. Please try again.