r61452 - in /branches/upstream/libtest-most-perl/current: ./ lib/Test/ lib/Test/Most/ t/

ansgar-guest at users.alioth.debian.org ansgar-guest at users.alioth.debian.org
Mon Aug 9 08:59:11 UTC 2010


Author: ansgar-guest
Date: Mon Aug  9 08:57:41 2010
New Revision: 61452

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=61452
Log:
[svn-upgrade] new version libtest-most-perl (0.22)

Added:
    branches/upstream/libtest-most-perl/current/t/exclude_test_modules.t
    branches/upstream/libtest-most-perl/current/t/import_strict_and_warnings.t
Modified:
    branches/upstream/libtest-most-perl/current/Build.PL
    branches/upstream/libtest-most-perl/current/Changes
    branches/upstream/libtest-most-perl/current/MANIFEST
    branches/upstream/libtest-most-perl/current/META.yml
    branches/upstream/libtest-most-perl/current/Makefile.PL
    branches/upstream/libtest-most-perl/current/README
    branches/upstream/libtest-most-perl/current/lib/Test/Most.pm
    branches/upstream/libtest-most-perl/current/lib/Test/Most/Exception.pm
    branches/upstream/libtest-most-perl/current/t/00-load.t
    branches/upstream/libtest-most-perl/current/t/common.t
    branches/upstream/libtest-most-perl/current/t/defer_plan.t
    branches/upstream/libtest-most-perl/current/t/env_bail.t
    branches/upstream/libtest-most-perl/current/t/env_die.t
    branches/upstream/libtest-most-perl/current/t/exception.t
    branches/upstream/libtest-most-perl/current/t/explain.t
    branches/upstream/libtest-most-perl/current/t/function_bail.t
    branches/upstream/libtest-most-perl/current/t/function_die.t
    branches/upstream/libtest-most-perl/current/t/import_bail.t
    branches/upstream/libtest-most-perl/current/t/import_die.t

Modified: branches/upstream/libtest-most-perl/current/Build.PL
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libtest-most-perl/current/Build.PL?rev=61452&op=diff
==============================================================================
--- branches/upstream/libtest-most-perl/current/Build.PL (original)
+++ branches/upstream/libtest-most-perl/current/Build.PL Mon Aug  9 08:57:41 2010
@@ -5,21 +5,21 @@
 my $builder = Module::Build->new(
     module_name       => 'Test::Most',
     license           => 'perl',
-    dist_author       => 'Curtis Poe <ovid at cpan.org>',
+    dist_author       => 'Curtis "Ovid" Poe <ovid at cpan.org>',
     dist_version_from => 'lib/Test/Most.pm',
     requires          => {
-        'Exception::Class'  => 1.14,
-        'Test::Simple'      => 0.82,
-        'Test::Exception'   => 0,
-        'Test::Differences' => 0,
-        'Test::Deep'        => 0,
-        'Test::Harness'     => 3.07,
-        'Test::Warn'        => 0.10,
+        'Exception::Class'  => '1.14',
+        'Test::More'        => '0.88',
+        'Test::Exception'   => '0.29',
+        'Test::Differences' => '0.500',
+        'Test::Deep'        => '0.106',
+        'Test::Harness'     => '3.07',
+        'Test::Warn'        => '0.11',
         'perl'              => '5.006',
     },
-    recommends => {
-        'Data::Dumper::Names' => 0.03,
-    },
+    meta_merge =>
+      { resources => { repository => 'http://github.com/Ovid/test--most' } },
+    recommends         => { 'Data::Dumper::Names' => 0.03, },
     add_to_cleanup     => ['Test-Most-*'],
     create_makefile_pl => 'traditional',
 );

Modified: branches/upstream/libtest-most-perl/current/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libtest-most-perl/current/Changes?rev=61452&op=diff
==============================================================================
--- branches/upstream/libtest-most-perl/current/Changes (original)
+++ branches/upstream/libtest-most-perl/current/Changes Mon Aug  9 08:57:41 2010
@@ -1,4 +1,33 @@
 Revision history for Test::Most
+
+0.22    2010-08-07
+        - Added always_explain() and always_show().
+        - Apply doc fixes from ranguard. Thanks :)
+
+0.21_04 2010-02-06
+        - Give people the ability to exclude test modules in case of
+          conflicts.  This is to resolve: "Prototype mismatch: sub
+          main::blessed ($) vs none" error with Moose and Test::Deep.  See
+          https://rt.cpan.org/Ticket/Display.html?id=54362&results=e73ff63c5bf9ba0f796efdba5773cf3f
+
+0.21_03 2010-02-06
+        - Bump up dependency on Test::Builder.  Need that for done_testing()
+          and to deprecate all_done().
+        - Remove strict and warnings from tests since they no longer need them
+          :)
+        - Decided to bump up the minimum version number for all test modules.
+          This module should be "one stop shopping" for most people.
+        - Moderately significant POD update.
+
+0.21_02 2010-02-06
+        - Import strict an warnings.
+        - Increase version requirement for
+          https://rt.cpan.org/Ticket/Display.html?id=44790  Thanks to Gerda
+          Shank for that.
+
+0.21_01 2009-02-18
+        - Have explain() depend on Test::More::note() (patch from Schwern)
+        - Depend on Test::More directly (patch from Scwhern)
 
 0.21    2009-02-18
         - No changes.  Update version for release.

Modified: branches/upstream/libtest-most-perl/current/MANIFEST
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libtest-most-perl/current/MANIFEST?rev=61452&op=diff
==============================================================================
--- branches/upstream/libtest-most-perl/current/MANIFEST (original)
+++ branches/upstream/libtest-most-perl/current/MANIFEST Mon Aug  9 08:57:41 2010
@@ -12,11 +12,13 @@
 t/env_bail.t
 t/env_die.t
 t/exception.t
+t/exclude_test_modules.t
 t/explain.t
 t/function_bail.t
 t/function_die.t
 t/import_bail.t
 t/import_die.t
+t/import_strict_and_warnings.t
 t/lib/OurTester.pm
 xt/author/pod-coverage.t
 xt/author/pod.t

Modified: branches/upstream/libtest-most-perl/current/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libtest-most-perl/current/META.yml?rev=61452&op=diff
==============================================================================
--- branches/upstream/libtest-most-perl/current/META.yml (original)
+++ branches/upstream/libtest-most-perl/current/META.yml Mon Aug  9 08:57:41 2010
@@ -1,31 +1,34 @@
 ---
+abstract: 'Most commonly needed test functions and features.'
+author:
+  - "Curtis \"Ovid\" Poe <ovid at cpan.org>"
+configure_requires:
+  Module::Build: 0.36
+generated_by: 'Module::Build version 0.3607'
+license: perl
+meta-spec:
+  url: http://module-build.sourceforge.net/META-spec-v1.4.html
+  version: 1.4
 name: Test-Most
-version: 0.21
-author:
-  - 'Curtis Poe <ovid at cpan.org>'
-abstract: Most commonly needed test functions and features.
-license: perl
-resources:
-  license: http://dev.perl.org/licenses/
-requires:
-  Exception::Class: 1.14
-  Test::Deep: 0
-  Test::Differences: 0
-  Test::Exception: 0
-  Test::Harness: 3.07
-  Test::Simple: 0.82
-  Test::Warn: 0.1
-  perl: 5.006
-recommends:
-  Data::Dumper::Names: 0.03
 provides:
   Test::Most:
     file: lib/Test/Most.pm
-    version: 0.21
+    version: 0.22
   Test::Most::Exception:
     file: lib/Test/Most/Exception.pm
-    version: 0.21
-generated_by: Module::Build version 0.2808
-meta-spec:
-  url: http://module-build.sourceforge.net/META-spec-v1.2.html
-  version: 1.2
+    version: 0.22
+recommends:
+  Data::Dumper::Names: 0.03
+requires:
+  Exception::Class: 1.14
+  Test::Deep: 0.106
+  Test::Differences: 0.500
+  Test::Exception: 0.29
+  Test::Harness: 3.07
+  Test::More: 0.88
+  Test::Warn: 0.11
+  perl: 5.006
+resources:
+  license: http://dev.perl.org/licenses/
+  repository: http://github.com/Ovid/test--most
+version: 0.22

Modified: branches/upstream/libtest-most-perl/current/Makefile.PL
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libtest-most-perl/current/Makefile.PL?rev=61452&op=diff
==============================================================================
--- branches/upstream/libtest-most-perl/current/Makefile.PL (original)
+++ branches/upstream/libtest-most-perl/current/Makefile.PL Mon Aug  9 08:57:41 2010
@@ -1,20 +1,21 @@
-# Note: this file was auto-generated by Module::Build::Compat version 0.03
+# Note: this file was auto-generated by Module::Build::Compat version 0.3607
+require 5.006;
 use ExtUtils::MakeMaker;
 WriteMakefile
 (
-          'PL_FILES' => {},
-          'INSTALLDIRS' => 'site',
-          'NAME' => 'Test::Most',
-          'EXE_FILES' => [],
-          'VERSION_FROM' => 'lib/Test/Most.pm',
-          'PREREQ_PM' => {
-                           'Test::Harness' => '3.07',
-                           'Test::Exception' => 0,
-                           'Test::Simple' => '0.82',
-                           'Exception::Class' => '1.14',
-                           'Test::Differences' => 0,
-                           'Test::Warn' => '0.1',
-                           'Test::Deep' => 0
-                         }
-        )
+  'PL_FILES' => {},
+  'INSTALLDIRS' => 'site',
+  'NAME' => 'Test::Most',
+  'EXE_FILES' => [],
+  'VERSION_FROM' => 'lib/Test/Most.pm',
+  'PREREQ_PM' => {
+                   'Test::Harness' => '3.07',
+                   'Test::Exception' => '0.29',
+                   'Exception::Class' => '1.14',
+                   'Test::More' => '0.88',
+                   'Test::Differences' => '0.500',
+                   'Test::Warn' => '0.11',
+                   'Test::Deep' => '0.106'
+                 }
+)
 ;

Modified: branches/upstream/libtest-most-perl/current/README
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libtest-most-perl/current/README?rev=61452&op=diff
==============================================================================
--- branches/upstream/libtest-most-perl/current/README (original)
+++ branches/upstream/libtest-most-perl/current/README Mon Aug  9 08:57:41 2010
@@ -17,16 +17,16 @@
 You can also look for information at:
 
     RT, CPAN's request tracker
-        http://rt.cpan.org/NoAuth/Bugs.html?Dist=Test-Extended
+        http://rt.cpan.org/NoAuth/Bugs.html?Dist=Test-Most
 
     AnnoCPAN, Annotated CPAN documentation
-        http://annocpan.org/dist/Test-Extended
+        http://annocpan.org/dist/Test-Most
 
     CPAN Ratings
-        http://cpanratings.perl.org/d/Test-Extended
+        http://cpanratings.perl.org/d/Test-Most
 
     Search CPAN
-        http://search.cpan.org/dist/Test-Extended
+        http://search.cpan.org/dist/Test-Most
 
 
 COPYRIGHT AND LICENCE
@@ -35,4 +35,3 @@
 
 This program is free software; you can redistribute it and/or modify it
 under the same terms as Perl itself.
-

Modified: branches/upstream/libtest-most-perl/current/lib/Test/Most.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libtest-most-perl/current/lib/Test/Most.pm?rev=61452&op=diff
==============================================================================
--- branches/upstream/libtest-most-perl/current/lib/Test/Most.pm (original)
+++ branches/upstream/libtest-most-perl/current/lib/Test/Most.pm Mon Aug  9 08:57:41 2010
@@ -17,10 +17,6 @@
     @Test::More::EXPORT = grep { $_ ne 'explain' } @Test::More::EXPORT;
     Test::More->import;
 }
-use Test::Differences;
-use Test::Exception;
-use Test::Deep;
-use Test::Warn;
 
 use Test::Builder;
 my $OK_FUNC;
@@ -34,16 +30,40 @@
 
 =head1 VERSION
 
-Version 0.21
+Version 0.22
 
 =cut
 
-our $VERSION = '0.21';
+our $VERSION = '0.22';
+$VERSION = eval $VERSION;
 
 =head1 SYNOPSIS
 
-This module provides you with the most commonly used testing functions and
-gives you a bit more fine-grained control over your test suite.
+Instead of this:
+
+    use strict;
+    use warnings;
+    use Test::Exception 0.88;
+    use Test::Differences 0.500;
+    use Test::Deep 0.106;
+    use Test::Warn 0.11;
+    use Test::More tests => 42;
+
+You type this:
+
+    use Test::Most tests => 42;
+
+=head1 DESCRIPTION
+
+L<Test::Most> exists to reduce boilerplate and to make your testing life
+easier.  We provide "one stop shopping" for most commonly used testing
+modules.  In fact, we often require the latest versions so that you get bug
+fixes through L<Test::Most> and don't have to keep upgrading these modules
+separately.
+
+This module provides you with the most commonly used testing functions, along
+with automatically turning on strict and warning and gives you a bit more
+fine-grained control over your test suite.
 
     use Test::Most tests => 4, 'die';
 
@@ -55,6 +75,14 @@
 As you can see, the C<eq_or_diff> test will fail.  Because 'die' is in the
 import list, the test program will halt at that point.
 
+If you do not want strict and warnings enabled, you must explicitly disable
+them.  Thus, you must be explicit about what you want and no longer need to
+worry about accidentally forgetting them.
+
+    use Test::Most tests => 4;
+    no strict;
+    no warnings;
+
 =head1 EXPORT
 
 All functions from the following modules will automatically be exported into
@@ -62,15 +90,15 @@
 
 =over 4
 
-=item * C<Test::More>
-
-=item * C<Test::Exception>
-
-=item * C<Test::Differences>
-
-=item * C<Test::Deep> 
-
-=item * C<Test::Warn>
+=item * L<Test::More>
+
+=item * L<Test::Exception>
+
+=item * L<Test::Differences>
+
+=item * L<Test::Deep> 
+
+=item * L<Test::Warn>
 
 =back
 
@@ -130,10 +158,10 @@
 
 =head2 C<explain>
 
-Similar to C<diag()>, but only outputs the message if C<$ENV{TEST_VERBOSE}> is
-set.  This is typically set by using the C<-v> switch with C<prove>.
-
-Unlike C<diag()>, any reference in the argument list is autumatically expanded
+Similar to C<note()>, the output will only be seen by the user by
+using the C<-v> switch with C<prove> or reading the raw TAP.
+
+Unlike C<note()>, any reference in the argument list is automatically expanded
 using C<Data::Dumper>.  Thus, instead of this:
 
  my $self = Some::Object->new($id);
@@ -157,7 +185,8 @@
 allows for a much cleaner diagnostic output and at the present time cannot be
 overridden.
 
-Requires C<Test::Harness> 3.07 or greater.
+Note that Test::More's C<explain> acts differently.  This C<explain>
+is equivalent to C<note explain> in Test::More.
 
 =head2 C<show>
 
@@ -189,7 +218,17 @@
 are not accessed via PadWalker and thus cannot be shown.  It would be nice to
 find a workaround for this.
 
+=head2 C<always_explain> and C<always_show>
+
+These are identical to C<explain> and C<show>, but like L<Test::More>'s
+C<diag> function, these will always emit output, regardless of whether or not
+you're in verbose mode.
+
 =head2 C<all_done>
+
+B<DEPRECATED>.  Use the new C<done_testing()> (added in
+L<Test::More|Test::More> since 0.87_01).  Instead. We're leaving this in here
+for a long deprecation cycle.  After a while, we might even start warning.
 
 If the plan is specified as C<defer_plan>, you may call C<&all_done> at the
 end of the test with an optional test number.  This lets you set the plan
@@ -238,7 +277,36 @@
 The C<die_on_fail> and C<bail_on_fail> functions will automatically set the
 desired behavior at runtime.
 
+=head2 Environment variables
+
+ DIE_ON_FAIL=1 prove t/
+ BAIL_ON_FAIL=1 prove t/
+
+If the C<DIE_ON_FAIL> or C<BAIL_ON_FAIL> environment variables are true, any
+tests which use C<Test::Most> will throw an exception or call BAIL_OUT on test
+failure.
+
+=head1 MISCELLANEOUS
+
+=head1 Excluding Test Modules
+
+Sometimes you want a exclude a particular test module.  For example,
+L<Test::Deep>, when used with L<Moose>, produces the following warning:
+
+    Prototype mismatch: sub main::blessed ($) vs none
+
+You can exclude this with by adding the module to the import list with a '-'
+symbol in front:
+
+    use Test::Most tests => 42, '-Test::Deep';
+
+See
+L<https://rt.cpan.org/Ticket/Display.html?id=54362&results=e73ff63c5bf9ba0f796efdba5773cf3f>
+for more information.
+
 =head2 Deferred plans
+
+B<DEPRECATED>.  Use C<done_testing()> from L<Test::More> instead.
 
  use Test::Most qw<defer_plan>;
  use My::Tests;
@@ -258,14 +326,22 @@
 that the number of tests you I<expected> is the number of tests unless you do
 so before any tests have run.  This fixes that problem.
 
-=head2 Environment variables
-
- DIE_ON_FAIL=1 prove t/
- BAIL_ON_FAIL=1 prove t/
-
-If the C<DIE_ON_FAIL> or C<BAIL_ON_FAIL> environment variables are true, any
-tests which use C<Test::Most> will throw an exception or call BAIL_OUT on test
-failure.
+=head2 One-stop shopping
+
+We generally require the latest stable versions of various test modules.  Why?
+Because they have bug fixes and new features.  You don't want to have to keep
+remembering them, so periodically we'll release new versions of L<Test::Most>
+just for bug 
+
+=head2 C<use ok>
+
+We do not bundle L<Test::use::ok>, though it's been requested.  That's because
+C<use_ok> is broken, but L<Test::use::ok> is also subtly broken (and a touch
+harder to fix).  See L<http://use.perl.org/~Ovid/journal/39859> for more
+information.
+
+If you want to test if you can use a module, just use it.  If it fails, the
+test will still fail and that's the desired result.
 
 =head1 RATIONALE
 
@@ -274,23 +350,38 @@
 halt on the first failure.  This module gives you that control.
 
 As for the reasons for the four test modules chosen, I ran code over a local
-copy of the CPAN to find the most commonly used testing modules.  Here were
-the top ten (out of 287):
-
- Test::More              44461
- Test                     8937
- Test::Exception          1379
- Test::Simple              731
- Test::Base                316
- Test::Builder::Tester     193
- Test::NoWarnings          174
- Test::Differences         146
- Test::MockObject          139
- Test::Deep                127
-
-The four modules chosen seemed the best fit for what C<Test::Most> is trying
-to do.  As of 0.02, we've added L<Test::Warn> by request.  It's not in the top
-ten, but it's a great and useful module.
+copy of the CPAN to find the most commonly used testing modules.  Here's the
+top twenty as of January 2010 (the numbers are different because we're now
+counting distributions which use a given module rather than simply the number
+of times a module is used).
+
+    1   Test::More                          14111
+    2   Test                                 1736
+    3   Test::Exception                       744
+    4   Test::Simple                          331
+    5   Test::Pod                             328
+    6   Test::Pod::Coverage                   274
+    7   Test::Perl::Critic                    248
+    8   Test::Base                            228
+    9   Test::NoWarnings                      155
+    10  Test::Distribution                    142
+    11  Test::Kwalitee                        138
+    12  Test::Deep                            128
+    13  Test::Warn                            127
+    14  Test::Differences                     102
+    15  Test::Spelling                        101
+    16  Test::MockObject                       87
+    17  Test::Builder::Tester                  84
+    18  Test::WWW::Mechanize::Catalyst         79
+    19  Test::UseAllModules                    63
+    20  Test::YAML::Meta                       61
+
+L<Test::Most> is number 24 on that list, if you're curious.  See
+L<http://blogs.perl.org/users/ovid/2010/01/most-popular-testing-modules---january-2010.html>.
+
+The modules chosen seemed the best fit for what C<Test::Most> is trying to do.
+As of 0.02, we've added L<Test::Warn> by request.  It's not in the top ten, but
+it's a great and useful module.
 
 =cut
 
@@ -298,39 +389,32 @@
     @ISA    = qw(Test::Builder::Module);
     @EXPORT = (
         @Test::More::EXPORT, 
-        @Test::Differences::EXPORT,
-        @Test::Exception::EXPORT,
-        @Test::Differences::EXPORT,
-        @Test::Deep::EXPORT,
-        @Test::Warn::EXPORT,
         qw<
             all_done
             bail_on_fail
             die_on_fail
             explain
+            always_explain
             last_test_failed
             restore_fail
             set_failure_handler
             show
+            always_show
         >
     );
-
-    if ( Test::Differences->VERSION <= 0.47 ) {
-
-        # XXX There's a bug in Test::Differences 0.47 which attempts to render
-        # an AoH in a cleaner 'table' format.
-        # http://rt.cpan.org/Public/Bug/Display.html?id=29732
-        no warnings 'redefine';
-        *Test::Differences::_isnt_HASH_of_scalars = sub {
-            return 1 if ref ne "HASH";
-            return scalar grep ref, values %$_;
-        };
-    }
 }
 
 sub import {
     my $bail_set = 0;
 
+    my %modules_to_load = map { $_ => 1 } qw/
+        Test::Differences
+        Test::Exception
+        Test::Deep
+        Test::Warn
+    /;
+    warnings->import;
+    strict->import;
     eval "use Data::Dumper::Names 0.03";
     $DATA_DUMPER_NAMES_INSTALLED = !$@;
 
@@ -349,33 +433,64 @@
             last;
         }
     }
-    for my $i ( 0 .. $#_ ) {
+    my $i = 0;
+    while ($i < @_) {
         if ( !$bail_set and ( 'die' eq $_[$i] ) ) {
             splice @_, $i, 1;
             die_on_fail();
-            last;
+            $i = 0;
+            next;
+        }
+        if ( $_[$i] =~ /^-(.*)/ ) {
+            my $module = $1;
+            splice @_, $i, 1;
+            unless (exists $modules_to_load{$module}) {
+                require Carp;
+                Carp::croak("Cannot remove non-existent Test::Module ($module)");
+            }
+            delete $modules_to_load{$module};
+            $i = 0;
+            next;
+        }
+        if ( 'defer_plan' eq $_[$i] ) {
+            splice @_, $i, 1;
+
+            my $builder = Test::Builder->new;
+            $builder->{Have_Plan} = 1
+              ; # don't like setting this directly, but Test::Builder::has_plan doe
+            $builder->{TEST_MOST_deferred_plan} = 1;
+            $builder->{TEST_MOST_all_done}      = 0;
+            $i = 0;
+            next;
+        }
+        $i++;
+    }
+    foreach my $module (keys %modules_to_load) {
+        eval "use $module";
+        no strict 'refs';
+        push @EXPORT => @{"${module}::EXPORT"};
+        if ( my $error = $@) {
+            require Carp;
+            Carp::croak($error);
         }
     }
-    for my $i ( 0 .. $#_ ) {
-       if ( 'defer_plan' eq $_[$i] ) {
-            splice @_, $i, 1;
-
-           my $builder = Test::Builder->new;
-           $builder->{Have_Plan} = 1; # don't like setting this directly, but Test::Builder::has_plan doe
-           $builder->{TEST_MOST_deferred_plan} = 1;
-           $builder->{TEST_MOST_all_done} = 0;
-
-           last;
-       }
-   }
 
     # 'magic' goto to avoid updating the callstack
     goto &Test::Builder::Module::import;
 }
 
 sub explain {
-    return unless $ENV{TEST_VERBOSE};
-    Test::More::diag(
+    _explain(\&Test::More::note, @_);
+}
+
+sub always_explain {
+    _explain(\&Test::More::diag, @_);
+}
+
+sub _explain {
+    my $diag = shift;
+    no warnings 'once';
+    $diag->(
         map {
             ref $_
               ? do {
@@ -391,16 +506,24 @@
 }
 
 sub show {
-    return unless $ENV{TEST_VERBOSE};
+    _show(\&Test::More::note, @_);
+}
+
+sub always_show {
+    _show(\&Test::More::diag, @_);
+}
+
+sub _show {
     unless ( $DATA_DUMPER_NAMES_INSTALLED ) {
         warn "Data::Dumper::Names 0.03 not found.  Use explain() instead of show()";
-        goto &explain;
+        goto &_explain;
     }
+    my $diag = shift;
     no warnings 'once';
     local $Data::Dumper::Indent         = 1;
     local $Data::Dumper::Sortkeys       = 1;
-    local $Data::Dumper::Names::UpLevel = $Data::Dumper::Names::UpLevel + 1;
-    Test::More::diag(Data::Dumper::Names::Dumper(@_));
+    local $Data::Dumper::Names::UpLevel = $Data::Dumper::Names::UpLevel + 2;
+    $diag->(Data::Dumper::Names::Dumper(@_));
 }
 
 sub die_on_fail {
@@ -484,9 +607,11 @@
 
 =head1 BUGS
 
-Please report any bugs or feature requests to C<bug-test-extended at rt.cpan.org>, or through
-the web interface at L<http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Test-Most>.  I will be notified, and then you'll
-automatically be notified of progress on your bug as I make changes.
+Please report any bugs or feature requests to C<bug-test-extended at
+rt.cpan.org>, or through the web interface at
+L<http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Test-Most>.  I will be
+notified, and then you'll automatically be notified of progress on your bug as
+I make changes.
 
 =head1 SUPPORT
 

Modified: branches/upstream/libtest-most-perl/current/lib/Test/Most/Exception.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libtest-most-perl/current/lib/Test/Most/Exception.pm?rev=61452&op=diff
==============================================================================
--- branches/upstream/libtest-most-perl/current/lib/Test/Most/Exception.pm (original)
+++ branches/upstream/libtest-most-perl/current/lib/Test/Most/Exception.pm Mon Aug  9 08:57:41 2010
@@ -12,11 +12,12 @@
 
 =head1 VERSION
 
-Version 0.21
+Version 0.22
 
 =cut
 
-our $VERSION = '0.21';
+our $VERSION = '0.22';
+$VERSION = eval $VERSION;
 
 =head1 SYNOPSIS
 

Modified: branches/upstream/libtest-most-perl/current/t/00-load.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libtest-most-perl/current/t/00-load.t?rev=61452&op=diff
==============================================================================
--- branches/upstream/libtest-most-perl/current/t/00-load.t (original)
+++ branches/upstream/libtest-most-perl/current/t/00-load.t Mon Aug  9 08:57:41 2010
@@ -16,7 +16,7 @@
       Test::Differences
       Test::Exception
       Test::Harness
-      Test::Simple
+      Test::More
       Test::Warn
     );
     foreach my $module (@dependencies) {

Modified: branches/upstream/libtest-most-perl/current/t/common.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libtest-most-perl/current/t/common.t?rev=61452&op=diff
==============================================================================
--- branches/upstream/libtest-most-perl/current/t/common.t (original)
+++ branches/upstream/libtest-most-perl/current/t/common.t Mon Aug  9 08:57:41 2010
@@ -1,7 +1,4 @@
 #!/usr/bin/perl
-
-use strict;
-use warnings;
 
 use lib 'lib', 't/lib';
 use Test::Most tests => 6;

Modified: branches/upstream/libtest-most-perl/current/t/defer_plan.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libtest-most-perl/current/t/defer_plan.t?rev=61452&op=diff
==============================================================================
--- branches/upstream/libtest-most-perl/current/t/defer_plan.t (original)
+++ branches/upstream/libtest-most-perl/current/t/defer_plan.t Mon Aug  9 08:57:41 2010
@@ -1,7 +1,4 @@
 #!/usr/bin/perl
-
-use strict;
-use warnings;
 
 use lib 'lib', 't/lib';
 use Test::Most qw<defer_plan>;

Modified: branches/upstream/libtest-most-perl/current/t/env_bail.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libtest-most-perl/current/t/env_bail.t?rev=61452&op=diff
==============================================================================
--- branches/upstream/libtest-most-perl/current/t/env_bail.t (original)
+++ branches/upstream/libtest-most-perl/current/t/env_bail.t Mon Aug  9 08:57:41 2010
@@ -1,7 +1,4 @@
 #!/usr/bin/perl
-
-use strict;
-use warnings;
 
 use lib 'lib', 't/lib';
 BEGIN { $ENV{BAIL_ON_FAIL} = 1 }

Modified: branches/upstream/libtest-most-perl/current/t/env_die.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libtest-most-perl/current/t/env_die.t?rev=61452&op=diff
==============================================================================
--- branches/upstream/libtest-most-perl/current/t/env_die.t (original)
+++ branches/upstream/libtest-most-perl/current/t/env_die.t Mon Aug  9 08:57:41 2010
@@ -1,7 +1,4 @@
 #!/usr/bin/perl
-
-use strict;
-use warnings;
 
 use lib 'lib', 't/lib';
 BEGIN { $ENV{DIE_ON_FAIL} = 1 }

Modified: branches/upstream/libtest-most-perl/current/t/exception.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libtest-most-perl/current/t/exception.t?rev=61452&op=diff
==============================================================================
--- branches/upstream/libtest-most-perl/current/t/exception.t (original)
+++ branches/upstream/libtest-most-perl/current/t/exception.t Mon Aug  9 08:57:41 2010
@@ -1,7 +1,4 @@
 #!/usr/bin/perl
-
-use strict;
-use warnings;
 
 use lib 'lib', 't/lib';
 use Test::Most tests => 4;

Added: branches/upstream/libtest-most-perl/current/t/exclude_test_modules.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libtest-most-perl/current/t/exclude_test_modules.t?rev=61452&op=file
==============================================================================
--- branches/upstream/libtest-most-perl/current/t/exclude_test_modules.t (added)
+++ branches/upstream/libtest-most-perl/current/t/exclude_test_modules.t Mon Aug  9 08:57:41 2010
@@ -1,0 +1,11 @@
+#!/usr/bin/perl
+
+use lib 'lib', 't/lib';
+use Test::Most tests => 4, '-Test::Exception';
+use OurTester qw($DIED dies);
+
+ok 1, 'Normal calls to ok() should succeed';
+is 2, 2, '... as should all passing tests';
+eq_or_diff [ 3, 4 ], [ 3, 4 ], '... and Test::Differences tests';
+ok !defined &lives_ok,
+  '... but excluding a test module excludes its test functions';

Modified: branches/upstream/libtest-most-perl/current/t/explain.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libtest-most-perl/current/t/explain.t?rev=61452&op=diff
==============================================================================
--- branches/upstream/libtest-most-perl/current/t/explain.t (original)
+++ branches/upstream/libtest-most-perl/current/t/explain.t Mon Aug  9 08:57:41 2010
@@ -1,19 +1,18 @@
 #!/usr/bin/perl
 
-use strict;
-use warnings;
-
 use lib 'lib', 't/lib';
-use Test::Most tests => 4;
+use Test::Most tests => 8;
 use Data::Dumper;
 
 no warnings 'redefine';
 
-my @EXPLAIN;
-local *Test::More::diag = sub { @EXPLAIN = @_ };
-local $ENV{TEST_VERBOSE} = 1;
+my @NOTE;
+local *Test::More::note = sub { @NOTE = @_ };
+my @DIAG;
+local *Test::More::diag = sub { @DIAG = @_ };
+
 explain 'foo';
-eq_or_diff \@EXPLAIN, ['foo'], 'Basic explain() should work just fine';
+eq_or_diff \@NOTE, ['foo'], 'Basic explain() should work just fine';
 
 my $aref = [qw/this that/];
 {
@@ -23,7 +22,7 @@
 
     explain 'hi', $aref, 'bye';
 
-    eq_or_diff \@EXPLAIN, [ 'hi', Dumper($aref), 'bye' ],
+    eq_or_diff \@NOTE, [ 'hi', Dumper($aref), 'bye' ],
       '... and also allow you to dump references';
 }
 
@@ -38,12 +37,47 @@
         eval "use Data::Dumper::Names ()";
         skip 'show() requires Data::Dumper::Names version 0.03 or better', 2
             if $@ or $Data::Dumper::Names::VERSION < .03;
-        eq_or_diff \@EXPLAIN,  [$expected],
+        eq_or_diff \@NOTE,  [$expected],
             '... and show() should try to show the variable name';
 
         show 3;
-        chomp @EXPLAIN;
-        eq_or_diff \@EXPLAIN, ['$VAR1 = 3;'],
+        chomp @NOTE;
+        eq_or_diff \@NOTE, ['$VAR1 = 3;'],
             '... but will default to $VARX names if it can\'t';
     }
 }
+
+always_explain 'foo';
+eq_or_diff \@DIAG, ['foo'], 'Basic always_explain() should work just fine';
+
+{
+    local $Data::Dumper::Indent   = 1;
+    local $Data::Dumper::Sortkeys = 1;
+    local $Data::Dumper::Terse    = 1;
+
+    always_explain 'hi', $aref, 'bye';
+
+    eq_or_diff \@DIAG, [ 'hi', Dumper($aref), 'bye' ],
+      '... and also allow you to dump references';
+}
+
+{
+    my $expected;
+    local $Data::Dumper::Indent = 1;
+    $expected = Dumper($aref);
+    $expected =~ s/VAR1/aref/;
+    always_show $aref;
+
+    SKIP: {
+        eval "use Data::Dumper::Names ()";
+        skip 'always_show() requires Data::Dumper::Names version 0.03 or better', 2
+            if $@ or $Data::Dumper::Names::VERSION < .03;
+        eq_or_diff \@DIAG,  [$expected],
+            '... and always_show() should try to show the variable name';
+
+        always_show 3;
+        chomp @DIAG;
+        eq_or_diff \@DIAG, ['$VAR1 = 3;'],
+            '... but will default to $VARX names if it can\'t';
+    }
+}

Modified: branches/upstream/libtest-most-perl/current/t/function_bail.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libtest-most-perl/current/t/function_bail.t?rev=61452&op=diff
==============================================================================
--- branches/upstream/libtest-most-perl/current/t/function_bail.t (original)
+++ branches/upstream/libtest-most-perl/current/t/function_bail.t Mon Aug  9 08:57:41 2010
@@ -1,7 +1,4 @@
 #!/usr/bin/perl
-
-use strict;
-use warnings;
 
 use lib 'lib',            't/lib';
 use Test::Most 'no_plan';#tests => 7;

Modified: branches/upstream/libtest-most-perl/current/t/function_die.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libtest-most-perl/current/t/function_die.t?rev=61452&op=diff
==============================================================================
--- branches/upstream/libtest-most-perl/current/t/function_die.t (original)
+++ branches/upstream/libtest-most-perl/current/t/function_die.t Mon Aug  9 08:57:41 2010
@@ -1,9 +1,6 @@
 #!/usr/bin/perl
 
-use strict;
-use warnings;
-
-use lib 'lib',            't/lib';
+use lib 'lib', 't/lib';
 use Test::Most tests => 7;
 use OurTester qw($DIED dies);
 

Modified: branches/upstream/libtest-most-perl/current/t/import_bail.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libtest-most-perl/current/t/import_bail.t?rev=61452&op=diff
==============================================================================
--- branches/upstream/libtest-most-perl/current/t/import_bail.t (original)
+++ branches/upstream/libtest-most-perl/current/t/import_bail.t Mon Aug  9 08:57:41 2010
@@ -1,7 +1,4 @@
 #!/usr/bin/perl
-
-use strict;
-use warnings;
 
 use lib 'lib',            't/lib';
 use Test::Most 'bail', tests => 7;

Modified: branches/upstream/libtest-most-perl/current/t/import_die.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libtest-most-perl/current/t/import_die.t?rev=61452&op=diff
==============================================================================
--- branches/upstream/libtest-most-perl/current/t/import_die.t (original)
+++ branches/upstream/libtest-most-perl/current/t/import_die.t Mon Aug  9 08:57:41 2010
@@ -1,7 +1,4 @@
 #!/usr/bin/perl
-
-use strict;
-use warnings;
 
 use lib 'lib',            't/lib';
 use Test::Most 'die', tests => 7;

Added: branches/upstream/libtest-most-perl/current/t/import_strict_and_warnings.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libtest-most-perl/current/t/import_strict_and_warnings.t?rev=61452&op=file
==============================================================================
--- branches/upstream/libtest-most-perl/current/t/import_strict_and_warnings.t (added)
+++ branches/upstream/libtest-most-perl/current/t/import_strict_and_warnings.t Mon Aug  9 08:57:41 2010
@@ -1,0 +1,8 @@
+use lib 'lib';
+
+use Test::Most tests => 2;
+
+eval '$foo = 1';
+ok my $error = $@, 'evaling an undeclared variable should fail';
+like $error, qr/Global symbol.*requires explicit package name/,
+    '... and give us an appropriate error message';




More information about the Pkg-perl-cvs-commits mailing list