'Test::Simple' =>
{
'MAINTAINER' => 'mschwern',
- 'DISTRIBUTION' => 'MSCHWERN/Test-Simple-0.96.tar.gz',
+ 'DISTRIBUTION' => 'MSCHWERN/Test-Simple-0.97_01.tar.gz',
'FILES' => q[cpan/Test-Simple],
'EXCLUDED' => [
qw{.perlcriticrc
+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]
use strict;
use warnings;
-our $VERSION = '0.96';
+our $VERSION = '0.97_01';
$VERSION = eval $VERSION; ## no critic (BuiltinFunctions::ProhibitStringyEval)
BEGIN {
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;
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
$tb->reset_outputs;
require Exporter;
our @ISA = qw(Exporter);
-our $VERSION = '0.96';
+our $VERSION = '0.97_01';
$VERSION = eval $VERSION; ## no critic (BuiltinFunctions::ProhibitStringyEval)
package Test::Builder::Tester;
use strict;
-our $VERSION = "1.20";
+our $VERSION = "1.21_01";
use Test::Builder;
use Symbol;
package Test::Builder::Tester::Color;
use strict;
-our $VERSION = "1.20";
+our $VERSION = "1.21_01";
require Test::Builder::Tester;
return warn @_, " at $file line $line\n";
}
-our $VERSION = '0.96';
+our $VERSION = '0.97_01';
$VERSION = eval $VERSION; ## no critic (BuiltinFunctions::ProhibitStringyEval)
use Test::Builder::Module;
=cut
-sub subtest($&) {
+sub subtest {
my ($name, $subtests) = @_;
my $tb = Test::More->builder;
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
use strict;
-our $VERSION = '0.96';
+our $VERSION = '0.97_01';
$VERSION = eval $VERSION; ## no critic (BuiltinFunctions::ProhibitStringyEval)
use Test::Builder::Module;
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
# 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.
+# at $0 line 380.
# Structures begin differing at:
-# \$got = (?-xism:a)
-# \$expected = (?-xism:b)
+# \$got = (?$modifiers:a)
+# \$expected = (?$modifiers:b)
ERR
}
{
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;
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;
];
}
}
}
-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;