r69705 - in /branches/upstream/libtest-simple-perl/current: ./ lib/Test/ lib/Test/Builder/ lib/Test/Builder/Tester/ t/ t/subtest/
ansgar at users.alioth.debian.org
ansgar at users.alioth.debian.org
Fri Feb 25 21:09:16 UTC 2011
Author: ansgar
Date: Fri Feb 25 21:08:59 2011
New Revision: 69705
URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=69705
Log:
[svn-upgrade] new version libtest-simple-perl (0.98)
Added:
branches/upstream/libtest-simple-perl/current/t/subtest/wstat.t
Modified:
branches/upstream/libtest-simple-perl/current/Changes
branches/upstream/libtest-simple-perl/current/MANIFEST
branches/upstream/libtest-simple-perl/current/MANIFEST.SKIP
branches/upstream/libtest-simple-perl/current/META.yml
branches/upstream/libtest-simple-perl/current/lib/Test/Builder.pm
branches/upstream/libtest-simple-perl/current/lib/Test/Builder/Module.pm
branches/upstream/libtest-simple-perl/current/lib/Test/Builder/Tester.pm
branches/upstream/libtest-simple-perl/current/lib/Test/Builder/Tester/Color.pm
branches/upstream/libtest-simple-perl/current/lib/Test/More.pm
branches/upstream/libtest-simple-perl/current/lib/Test/Simple.pm
branches/upstream/libtest-simple-perl/current/t/fail-like.t
branches/upstream/libtest-simple-perl/current/t/is_deeply_fail.t
branches/upstream/libtest-simple-perl/current/t/subtest/plan.t
branches/upstream/libtest-simple-perl/current/t/utf8.t
Modified: branches/upstream/libtest-simple-perl/current/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libtest-simple-perl/current/Changes?rev=69705&op=diff
==============================================================================
--- branches/upstream/libtest-simple-perl/current/Changes (original)
+++ branches/upstream/libtest-simple-perl/current/Changes Fri Feb 25 21:08:59 2011
@@ -1,3 +1,27 @@
+0.98 Wed, 23 Feb 2011 14:38:02 +1100
+ Bug Fixes
+ * subtest() should not fail if $? is non-zero. (Aaron Crane)
+
+ Docs
+ * The behavior of is() and undef has been documented. (Pedro Melo)
+
+
+0.97_01 Fri Aug 27 22:50:30 PDT 2010
+ Test Fixes
+ * Adapted the tests for the new Perl 5.14 regex stringification.
+ (Karl Williamson) [github 44]
+
+ Doc Fixes
+ * Document how to test "use Foo ()". (Todd Rinaldo) [github 41]
+
+ Feature Changes
+ * subtest() no longer has a prototype. It was just getting in the way.
+ [rt.cpan.org 54239]
+ * The filehandles used by default will now inherit any filehandle
+ disciplines from STDOUT and STDERR IF AND ONLY IF they were applied
+ before Test::Builder is loaded. More later. [rt.cpan.org 46542]
+
+
0.96 Tue Aug 10 21:13:04 PDT 2010
Bug Fixes
* You can call done_testing() again after reset() [googlecode 59]
Modified: branches/upstream/libtest-simple-perl/current/MANIFEST
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libtest-simple-perl/current/MANIFEST?rev=69705&op=diff
==============================================================================
--- branches/upstream/libtest-simple-perl/current/MANIFEST (original)
+++ branches/upstream/libtest-simple-perl/current/MANIFEST Fri Feb 25 21:08:59 2011
@@ -128,6 +128,7 @@
t/subtest/predicate.t
t/subtest/singleton.t
t/subtest/todo.t
+t/subtest/wstat.t
t/tbm_doesnt_set_exported_to.t
t/Tester/tbt_01basic.t
t/Tester/tbt_02fhrestore.t
Modified: branches/upstream/libtest-simple-perl/current/MANIFEST.SKIP
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libtest-simple-perl/current/MANIFEST.SKIP?rev=69705&op=diff
==============================================================================
--- branches/upstream/libtest-simple-perl/current/MANIFEST.SKIP (original)
+++ branches/upstream/libtest-simple-perl/current/MANIFEST.SKIP Fri Feb 25 21:08:59 2011
@@ -1,5 +1,5 @@
-#!start included /usr/local/perl/5.10.0/lib/5.10.0/ExtUtils/MANIFEST.SKIP
+#!start included /Users/schwern/perl5/perlbrew/perls/perl-v5.12.2/lib/5.12.2/ExtUtils/MANIFEST.SKIP
# Avoid version control files.
\bRCS\b
\bCVS\b
@@ -9,6 +9,12 @@
\B\.git\b
\B\.gitignore\b
\b_darcs\b
+\B\.cvsignore$
+
+# Avoid VMS specific MakeMaker generated files
+\bDescrip.MMS$
+\bDESCRIP.MMS$
+\bdescrip.mms$
# Avoid Makemaker generated and utility files.
\bMANIFEST\.bak
@@ -22,6 +28,10 @@
# Avoid Module::Build generated and utility files.
\bBuild$
\b_build/
+\bBuild.bat$
+\bBuild.COM$
+\bBUILD.COM$
+\bbuild.com$
# Avoid temp and backup files.
~$
@@ -29,10 +39,23 @@
\#$
\b\.#
\.bak$
+\.tmp$
+\.#
+\.rej$
-# Avoid Devel::Cover files.
+# Avoid OS-specific files/dirs
+# Mac OSX metadata
+\B\.DS_Store
+# Mac OSX SMB mount metadata files
+\B\._
+
+# Avoid Devel::Cover and Devel::CoverX::Covered files.
\bcover_db\b
-#!end included /usr/local/perl/5.10.0/lib/5.10.0/ExtUtils/MANIFEST.SKIP
+\bcovered\b
+
+# Avoid MYMETA files
+^MYMETA\.
+#!end included /Users/schwern/perl5/perlbrew/perls/perl-v5.12.2/lib/5.12.2/ExtUtils/MANIFEST.SKIP
# Avoid this one test that doesn't work yet
@@ -48,4 +71,4 @@
^cover_db/
# Don't include our dist director
-^Test-Simple-
+^Test-Simple-
Modified: branches/upstream/libtest-simple-perl/current/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libtest-simple-perl/current/META.yml?rev=69705&op=diff
==============================================================================
--- branches/upstream/libtest-simple-perl/current/META.yml (original)
+++ branches/upstream/libtest-simple-perl/current/META.yml Fri Feb 25 21:08:59 2011
@@ -1,6 +1,6 @@
--- #YAML:1.0
name: Test-Simple
-version: 0.96
+version: 0.98
abstract: Basic utilities for writing tests.
author:
- Michael G Schwern <schwern at pobox.com>
@@ -23,7 +23,7 @@
directory:
- t
- inc
-generated_by: ExtUtils::MakeMaker version 6.56
+generated_by: ExtUtils::MakeMaker version 6.57_06
meta-spec:
url: http://module-build.sourceforge.net/META-spec-v1.4.html
version: 1.4
Modified: branches/upstream/libtest-simple-perl/current/lib/Test/Builder.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libtest-simple-perl/current/lib/Test/Builder.pm?rev=69705&op=diff
==============================================================================
--- branches/upstream/libtest-simple-perl/current/lib/Test/Builder.pm (original)
+++ branches/upstream/libtest-simple-perl/current/lib/Test/Builder.pm Fri Feb 25 21:08:59 2011
@@ -4,7 +4,7 @@
use strict;
use warnings;
-our $VERSION = '0.96';
+our $VERSION = '0.98';
$VERSION = eval $VERSION; ## no critic (BuiltinFunctions::ProhibitStringyEval)
BEGIN {
@@ -312,6 +312,8 @@
if( $self->{Child_Name} ) {
$self->croak("Can't call finalize() with child ($self->{Child_Name}) active");
}
+
+ local $? = 0; # don't fail if $subtests happened to set $? nonzero
$self->_ending;
# XXX This will only be necessary for TAP envelopes (we think)
@@ -923,12 +925,16 @@
Like Test::More's C<is()>. Checks if C<$got eq $expected>. This is the
string version.
+C<undef> only ever matches another C<undef>.
+
=item B<is_num>
$Test->is_num($got, $expected, $name);
Like Test::More's C<is()>. Checks if C<$got == $expected>. This is the
numeric version.
+
+C<undef> only ever matches another C<undef>.
=cut
@@ -1880,8 +1886,8 @@
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 );
+ $self->_copy_io_layers( \*STDOUT, $Testout );
+ $self->_copy_io_layers( \*STDERR, $Testerr );
$self->{Opened_Testhandles} = 1;
@@ -1896,12 +1902,20 @@
require PerlIO;
my @src_layers = PerlIO::get_layers($src);
- binmode $dst, join " ", map ":$_", @src_layers if @src_layers;
+ _apply_layers($dst, @src_layers) if @src_layers;
}
);
return;
}
+
+sub _apply_layers {
+ my ($fh, @layers) = @_;
+ my %seen;
+ my @unique = grep { $_ ne 'unix' and !$seen{$_}++ } @layers;
+ binmode($fh, join(":", "", "raw", @unique));
+}
+
=item reset_outputs
Modified: branches/upstream/libtest-simple-perl/current/lib/Test/Builder/Module.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libtest-simple-perl/current/lib/Test/Builder/Module.pm?rev=69705&op=diff
==============================================================================
--- branches/upstream/libtest-simple-perl/current/lib/Test/Builder/Module.pm (original)
+++ branches/upstream/libtest-simple-perl/current/lib/Test/Builder/Module.pm Fri Feb 25 21:08:59 2011
@@ -7,7 +7,7 @@
require Exporter;
our @ISA = qw(Exporter);
-our $VERSION = '0.96';
+our $VERSION = '0.98';
$VERSION = eval $VERSION; ## no critic (BuiltinFunctions::ProhibitStringyEval)
@@ -58,7 +58,7 @@
All arguments passed to import() are passed onto
C<< Your::Module->builder->plan() >> with the exception of
-C<import =>[qw(things to import)]>.
+C<< import =>[qw(things to import)] >>.
use Your::Module import => [qw(this that)], tests => 23;
Modified: branches/upstream/libtest-simple-perl/current/lib/Test/Builder/Tester.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libtest-simple-perl/current/lib/Test/Builder/Tester.pm?rev=69705&op=diff
==============================================================================
--- branches/upstream/libtest-simple-perl/current/lib/Test/Builder/Tester.pm (original)
+++ branches/upstream/libtest-simple-perl/current/lib/Test/Builder/Tester.pm Fri Feb 25 21:08:59 2011
@@ -1,7 +1,7 @@
package Test::Builder::Tester;
use strict;
-our $VERSION = "1.20";
+our $VERSION = "1.22";
use Test::Builder;
use Symbol;
Modified: branches/upstream/libtest-simple-perl/current/lib/Test/Builder/Tester/Color.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libtest-simple-perl/current/lib/Test/Builder/Tester/Color.pm?rev=69705&op=diff
==============================================================================
--- branches/upstream/libtest-simple-perl/current/lib/Test/Builder/Tester/Color.pm (original)
+++ branches/upstream/libtest-simple-perl/current/lib/Test/Builder/Tester/Color.pm Fri Feb 25 21:08:59 2011
@@ -1,7 +1,7 @@
package Test::Builder::Tester::Color;
use strict;
-our $VERSION = "1.20";
+our $VERSION = "1.22";
require Test::Builder::Tester;
Modified: branches/upstream/libtest-simple-perl/current/lib/Test/More.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libtest-simple-perl/current/lib/Test/More.pm?rev=69705&op=diff
==============================================================================
--- branches/upstream/libtest-simple-perl/current/lib/Test/More.pm (original)
+++ branches/upstream/libtest-simple-perl/current/lib/Test/More.pm Fri Feb 25 21:08:59 2011
@@ -17,7 +17,7 @@
return warn @_, " at $file line $line\n";
}
-our $VERSION = '0.96';
+our $VERSION = '0.98';
$VERSION = eval $VERSION; ## no critic (BuiltinFunctions::ProhibitStringyEval)
use Test::Builder::Module;
@@ -316,6 +316,11 @@
ok( ultimate_answer() eq 42, "Meaning of Life" );
ok( $foo ne '', "Got some foo" );
+
+C<undef> will only ever match C<undef>. So you can test a value
+agains C<undef> like this:
+
+ is($not_defined, undef, "undefined as expected");
(Mnemonic: "This is that." "This isn't that.")
@@ -735,7 +740,7 @@
=cut
-sub subtest($&) {
+sub subtest {
my ($name, $subtests) = @_;
my $tb = Test::More->builder;
@@ -818,6 +823,11 @@
BEGIN { use_ok('Some::Module') }
BEGIN { ...some code that depends on the use... }
+
+If you want the equivalent of C<use Foo ()>, use a module but not
+import anything, use C<require_ok>.
+
+ BEGIN { require_ok "Foo" }
=cut
Modified: branches/upstream/libtest-simple-perl/current/lib/Test/Simple.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libtest-simple-perl/current/lib/Test/Simple.pm?rev=69705&op=diff
==============================================================================
--- branches/upstream/libtest-simple-perl/current/lib/Test/Simple.pm (original)
+++ branches/upstream/libtest-simple-perl/current/lib/Test/Simple.pm Fri Feb 25 21:08:59 2011
@@ -4,7 +4,7 @@
use strict;
-our $VERSION = '0.96';
+our $VERSION = '0.98';
$VERSION = eval $VERSION; ## no critic (BuiltinFunctions::ProhibitStringyEval)
use Test::Builder::Module;
Modified: branches/upstream/libtest-simple-perl/current/t/fail-like.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libtest-simple-perl/current/t/fail-like.t?rev=69705&op=diff
==============================================================================
--- branches/upstream/libtest-simple-perl/current/t/fail-like.t (original)
+++ branches/upstream/libtest-simple-perl/current/t/fail-like.t Fri Feb 25 21:08:59 2011
@@ -44,25 +44,28 @@
not ok 1 - is foo like that
OUT
+ # Accept both old and new-style stringification
+ my $modifiers = (qr/foobar/ =~ /\Q(?^/) ? '\\^' : '-xism';
+
my $err_re = <<ERR;
# Failed test 'is foo like that'
# at .* line 1\.
# 'foo'
-# doesn't match '\\(\\?-xism:that\\)'
+# doesn't match '\\(\\?$modifiers:that\\)'
ERR
$TB->like($err->read, qr/^$err_re$/, 'failing errors');
}
{
- # line 59
+ # line 62
like("foo", "not a regex");
$TB->is_eq($out->read, <<OUT);
not ok 2
OUT
$TB->is_eq($err->read, <<OUT);
-# Failed test at $0 line 59.
+# Failed test at $0 line 62.
# 'not a regex' doesn't look much like a regex to me.
OUT
Modified: branches/upstream/libtest-simple-perl/current/t/is_deeply_fail.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libtest-simple-perl/current/t/is_deeply_fail.t?rev=69705&op=diff
==============================================================================
--- branches/upstream/libtest-simple-perl/current/t/is_deeply_fail.t (original)
+++ branches/upstream/libtest-simple-perl/current/t/is_deeply_fail.t Fri Feb 25 21:08:59 2011
@@ -373,15 +373,18 @@
# rt.cpan.org 53469
{
-#line 377
+
+ # Accept both old and new-style stringification
+ my $modifiers = (qr/foobar/ =~ /\Q(?^/) ? '^' : '-xism';
+#line 380
ok !is_deeply( qr/a/, qr/b/, "different regexes" );
is( $out, "not ok 29 - different regexes\n" );
is( $err, <<ERR, ' right diagnostic' );
# Failed test 'different regexes'
-# at $0 line 377.
-# Structures begin differing at:
-# \$got = (?-xism:a)
-# \$expected = (?-xism:b)
+# at $0 line 380.
+# Structures begin differing at:
+# \$got = (?$modifiers:a)
+# \$expected = (?$modifiers:b)
ERR
}
@@ -415,4 +418,4 @@
is( $out, "not ok 40 - {x => 0} != {x => undef}\n" );
ok !is_deeply( {x => ''}, {x => undef}, "{x => ''} != {x => undef}" );
is( $out, "not ok 41 - {x => ''} != {x => undef}\n" );
-}
+}
Modified: branches/upstream/libtest-simple-perl/current/t/subtest/plan.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libtest-simple-perl/current/t/subtest/plan.t?rev=69705&op=diff
==============================================================================
--- branches/upstream/libtest-simple-perl/current/t/subtest/plan.t (original)
+++ branches/upstream/libtest-simple-perl/current/t/subtest/plan.t Fri Feb 25 21:08:59 2011
@@ -22,7 +22,7 @@
{
ok defined &subtest, 'subtest() should be exported to our namespace';
- is prototype('subtest'), '$&', '... with the appropriate prototype';
+ is prototype('subtest'), undef, '... has no prototype';
subtest 'subtest with plan', sub {
plan tests => 2;
Added: branches/upstream/libtest-simple-perl/current/t/subtest/wstat.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libtest-simple-perl/current/t/subtest/wstat.t?rev=69705&op=file
==============================================================================
--- branches/upstream/libtest-simple-perl/current/t/subtest/wstat.t (added)
+++ branches/upstream/libtest-simple-perl/current/t/subtest/wstat.t Fri Feb 25 21:08:59 2011
@@ -1,0 +1,24 @@
+#!/usr/bin/perl -w
+
+# Test that setting $? doesn't affect subtest success
+
+use strict;
+use Test::More;
+
+subtest foo => sub {
+ plan tests => 1;
+ $? = 1;
+ pass('bar');
+};
+
+is $?, 1, "exit code keeps on from a subtest";
+
+subtest foo2 => sub {
+ plan tests => 1;
+ pass('bar2');
+ $? = 1;
+};
+
+is $?, 1, "exit code keeps on from a subtest";
+
+done_testing(4);
Modified: branches/upstream/libtest-simple-perl/current/t/utf8.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libtest-simple-perl/current/t/utf8.t?rev=69705&op=diff
==============================================================================
--- branches/upstream/libtest-simple-perl/current/t/utf8.t (original)
+++ branches/upstream/libtest-simple-perl/current/t/utf8.t Fri Feb 25 21:08:59 2011
@@ -10,15 +10,14 @@
use strict;
use warnings;
-use Test::More skip_all => 'Not yet implemented';
-
my $have_perlio;
BEGIN {
# All together so Test::More sees the open discipline
$have_perlio = eval q[
- use PerlIO;
- use open ':std', ':locale';
- use Test::More;
+ require PerlIO;
+ binmode *STDOUT, ":encoding(utf8)";
+ binmode *STDERR, ":encoding(utf8)";
+ require Test::More;
1;
];
}
@@ -53,10 +52,9 @@
}
}
-SKIP: {
- skip( "Can't test in general because their locale is unknown", 2 )
- unless $ENV{AUTHOR_TESTING};
+# Test utf8 is ok.
+{
my $uni = "\x{11e}";
my @warnings;
More information about the Pkg-perl-cvs-commits
mailing list