From: Steve Peters Date: Wed, 13 Sep 2006 13:35:32 +0000 (+0000) Subject: Upgrade to Test-Simple-0.64_02 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=b7f9bbeb27deb5ace5bde1b13a5221532eb90ed0;p=p5sagit%2Fp5-mst-13.2.git Upgrade to Test-Simple-0.64_02 p4raw-id: //depot/perl@28836 --- diff --git a/lib/Test/Builder.pm b/lib/Test/Builder.pm index d9ebef1..d0b379a 100644 --- a/lib/Test/Builder.pm +++ b/lib/Test/Builder.pm @@ -8,14 +8,15 @@ $^C ||= 0; use strict; use vars qw($VERSION); -$VERSION = '0.33'; +$VERSION = '0.33_02'; $VERSION = eval $VERSION; # make the alpha version come out as a number # Make Test::Builder thread-safe for ithreads. BEGIN { use Config; - # Load threads::shared when threads are turned on - if( $] >= 5.008 && $Config{useithreads} && $INC{'threads.pm'}) { + # Load threads::shared when threads are turned on. + # 5.8.0's threads are so busted we no longer support them. + if( $] >= 5.008001 && $Config{useithreads} && $INC{'threads.pm'}) { require threads::shared; # Hack around YET ANOTHER threads::shared bug. It would @@ -35,7 +36,7 @@ BEGIN { $$data = ${$_[0]}; } else { - die "Unknown type: ".$type; + die("Unknown type: ".$type); } $_[0] = &threads::shared::share($_[0]); @@ -50,14 +51,14 @@ BEGIN { ${$_[0]} = $$data; } else { - die "Unknown type: ".$type; + die("Unknown type: ".$type); } return $_[0]; }; } - # 5.8.0's threads::shared is busted when threads are off. - # We emulate it here. + # 5.8.0's threads::shared is busted when threads are off + # and earlier Perls just don't have that module at all. else { *share = sub { return $_[0] }; *lock = sub { 0 }; @@ -247,8 +248,7 @@ sub plan { return unless $cmd; if( $self->{Have_Plan} ) { - die sprintf "You tried to plan twice! Second plan at %s line %d\n", - ($self->caller)[1,2]; + $self->croak("You tried to plan twice"); } if( $cmd eq 'no_plan' ) { @@ -259,20 +259,19 @@ sub plan { } elsif( $cmd eq 'tests' ) { if( $arg ) { + local $Level = $Level + 1; return $self->expected_tests($arg); } elsif( !defined $arg ) { - die "Got an undefined number of tests. Looks like you tried to ". - "say how many tests you plan to run but made a mistake.\n"; + $self->croak("Got an undefined number of tests"); } elsif( !$arg ) { - die "You said to run 0 tests! You've got to run something.\n"; + $self->croak("You said to run 0 tests"); } } else { - require Carp; my @args = grep { defined } ($cmd, $arg); - Carp::croak("plan() doesn't understand @args"); + $self->croak("plan() doesn't understand @args"); } return 1; @@ -293,7 +292,7 @@ sub expected_tests { my($max) = @_; if( @_ ) { - die "Number of tests must be a postive integer. You gave it '$max'.\n" + $self->croak("Number of tests must be a positive integer. You gave it '$max'") unless $max =~ /^\+?\d+$/ and $max > 0; $self->{Expected_Tests} = $max; @@ -386,10 +385,7 @@ sub ok { # store, so we turn it into a boolean. $test = $test ? 1 : 0; - unless( $self->{Have_Plan} ) { - require Carp; - Carp::croak("You tried to run a test without a plan! Gotta have a plan."); - } + $self->_plan_check; lock $self->{Curr_Test}; $self->{Curr_Test}++; @@ -451,10 +447,10 @@ ERR if( defined $name ) { $self->diag(qq[ $msg test '$name'\n]); - $self->diag(qq[ in $file at line $line.\n]); + $self->diag(qq[ at $file line $line.\n]); } else { - $self->diag(qq[ $msg test in $file at line $line.\n]); + $self->diag(qq[ $msg test at $file line $line.\n]); } } @@ -889,10 +885,7 @@ sub skip { $why ||= ''; $self->_unoverload_str(\$why); - unless( $self->{Have_Plan} ) { - require Carp; - Carp::croak("You tried to run tests without a plan! Gotta have a plan."); - } + $self->_plan_check; lock($self->{Curr_Test}); $self->{Curr_Test}++; @@ -933,10 +926,7 @@ sub todo_skip { my($self, $why) = @_; $why ||= ''; - unless( $self->{Have_Plan} ) { - require Carp; - Carp::croak("You tried to run tests without a plan! Gotta have a plan."); - } + $self->_plan_check; lock($self->{Curr_Test}); $self->{Curr_Test}++; @@ -1182,6 +1172,7 @@ sub _print { print $fh $msg; } +=begin private =item B<_print_diag> @@ -1189,6 +1180,8 @@ sub _print { Like _print, but prints to the current diagnostic filehandle. +=end private + =cut sub _print_diag { @@ -1232,7 +1225,7 @@ sub output { my($self, $fh) = @_; if( defined $fh ) { - $self->{Out_FH} = _new_fh($fh); + $self->{Out_FH} = $self->_new_fh($fh); } return $self->{Out_FH}; } @@ -1241,7 +1234,7 @@ sub failure_output { my($self, $fh) = @_; if( defined $fh ) { - $self->{Fail_FH} = _new_fh($fh); + $self->{Fail_FH} = $self->_new_fh($fh); } return $self->{Fail_FH}; } @@ -1250,23 +1243,24 @@ sub todo_output { my($self, $fh) = @_; if( defined $fh ) { - $self->{Todo_FH} = _new_fh($fh); + $self->{Todo_FH} = $self->_new_fh($fh); } return $self->{Todo_FH}; } sub _new_fh { + my $self = shift; my($file_or_fh) = shift; my $fh; - if( _is_fh($file_or_fh) ) { + if( $self->_is_fh($file_or_fh) ) { $fh = $file_or_fh; } else { $fh = do { local *FH }; - open $fh, ">$file_or_fh" or - die "Can't open test output log $file_or_fh: $!"; + open $fh, ">$file_or_fh" or + $self->croak("Can't open test output log $file_or_fh: $!"); _autoflush($fh); } @@ -1275,6 +1269,7 @@ sub _new_fh { sub _is_fh { + my $self = shift; my $maybe_fh = shift; return 0 unless defined $maybe_fh; @@ -1325,6 +1320,49 @@ sub _open_testhandles { } +=item carp + + $tb->carp(@message); + +Warns with C<@message> but the message will appear to come from the +point where the original test function was called (C<$tb->caller>). + +=item croak + + $tb->croak(@message); + +Dies with C<@message> but the message will appear to come from the +point where the original test function was called (C<$tb->caller>). + +=cut + +sub _message_at_caller { + my $self = shift; + + local $Level = $Level + 2; + my($pack, $file, $line) = $self->caller; + return join("", @_) . " at $file line $line.\n"; +} + +sub carp { + my $self = shift; + warn $self->_message_at_caller(@_); +} + +sub croak { + my $self = shift; + die $self->_message_at_caller(@_); +} + +sub _plan_check { + my $self = shift; + + unless( $self->{Have_Plan} ) { + local $Level = $Level + 1; + $self->croak("You tried to run a test without a plan"); + } +} + =back @@ -1352,8 +1390,7 @@ sub current_test { lock($self->{Curr_Test}); if( defined $num ) { unless( $self->{Have_Plan} ) { - require Carp; - Carp::croak("Can't change the current test number without a plan!"); + $self->croak("Can't change the current test number without a plan!"); } $self->{Curr_Test} = $num; @@ -1523,16 +1560,16 @@ error message. sub _sanity_check { my $self = shift; - _whoa($self->{Curr_Test} < 0, 'Says here you ran a negative number of tests!'); - _whoa(!$self->{Have_Plan} and $self->{Curr_Test}, + $self->_whoa($self->{Curr_Test} < 0, 'Says here you ran a negative number of tests!'); + $self->_whoa(!$self->{Have_Plan} and $self->{Curr_Test}, 'Somehow your tests ran without a plan!'); - _whoa($self->{Curr_Test} != @{ $self->{Test_Results} }, + $self->_whoa($self->{Curr_Test} != @{ $self->{Test_Results} }, 'Somehow you got a different number of results than tests ran!'); } =item B<_whoa> - _whoa($check, $description); + $self->_whoa($check, $description); A sanity check, similar to assert(). If the $check is true, something has gone horribly wrong. It will die with the given $description and @@ -1541,9 +1578,10 @@ a note to contact the author. =cut sub _whoa { - my($check, $desc) = @_; + my($self, $check, $desc) = @_; if( $check ) { - die <croak(<<"WHOA"); WHOA! $desc This should never happen! Please contact the author immediately! WHOA @@ -1713,10 +1751,13 @@ If you fail more than 254 tests, it will be reported as 254. =head1 THREADS -In perl 5.8.0 and later, Test::Builder is thread-safe. The test +In perl 5.8.1 and later, Test::Builder is thread-safe. The test number is shared amongst all threads. This means if one thread sets the test number using current_test() they will all be effected. +While versions earlier than 5.8.1 had threads they contain too many +bugs to support. + Test::Builder is only thread-aware if threads.pm is loaded I Test::Builder. diff --git a/lib/Test/Builder/Module.pm b/lib/Test/Builder/Module.pm index 855488a..146e434 100644 --- a/lib/Test/Builder/Module.pm +++ b/lib/Test/Builder/Module.pm @@ -5,7 +5,7 @@ use Test::Builder; require Exporter; @ISA = qw(Exporter); -$VERSION = '0.03'; +$VERSION = '0.03_02'; use strict; diff --git a/lib/Test/Builder/Tester.pm b/lib/Test/Builder/Tester.pm index 7eab5a5..ab32588 100644 --- a/lib/Test/Builder/Tester.pm +++ b/lib/Test/Builder/Tester.pm @@ -2,7 +2,7 @@ package Test::Builder::Tester; use strict; use vars qw(@EXPORT $VERSION @ISA); -$VERSION = "1.04"; +$VERSION = "1.04_02"; use Test::Builder; use Symbol; @@ -497,17 +497,17 @@ sub expect my @checks = @_; foreach my $check (@checks) { $check = $self->_translate_Failed_check($check); - push @{$self->[2]}, ref $check ? $check : "$check\n"; + push @{$self->{wanted}}, ref $check ? $check : "$check\n"; } } -sub _translate_Failed_check +sub _translate_Failed_check { my($self, $check) = @_; if( $check =~ /\A(.*)# (Failed .*test) \((.*?) at line (\d+)\)\z/ ) { - $check = qr/\Q$1\E#\s+\Q$2\E.*?\n?.*?\Q$3\E at line \Q$4\E.*\n?/; + $check = qr/\Q$1\E#\s+\Q$2\E.*?\n?.*?\Qat $3\E line \Q$4\E.*\n?/; } return $check; @@ -524,8 +524,8 @@ sub check # turn off warnings as these might be undef local $^W = 0; - my @checks = @{$self->[2]}; - my $got = $self->[1]; + my @checks = @{$self->{wanted}}; + my $got = $self->{got}; foreach my $check (@checks) { $check = qr/^\Q$check\E/ unless ref $check; return 0 unless $got =~ s/^$check//; @@ -592,26 +592,30 @@ sub complaint sub reset { my $self = shift; - @$self = ($self->[0], '', []); + %$self = ( + type => $self->{type}, + got => '', + wanted => [], + ); } sub got { my $self = shift; - return $self->[1]; + return $self->{got}; } sub wanted { my $self = shift; - return $self->[2]; + return $self->{wanted}; } sub type { my $self = shift; - return $self->[0]; + return $self->{type}; } ### @@ -620,13 +624,16 @@ sub type sub PRINT { my $self = shift; - $self->[1] .= join '', @_; + $self->{got} .= join '', @_; } sub TIEHANDLE { my($class, $type) = @_; - my $self = bless [$type], $class; + my $self = bless { + type => $type + }, $class; + $self->reset; return $self; diff --git a/lib/Test/More.pm b/lib/Test/More.pm index 465ccd3..4759e68 100644 --- a/lib/Test/More.pm +++ b/lib/Test/More.pm @@ -16,7 +16,7 @@ sub _carp { use vars qw($VERSION @ISA @EXPORT %EXPORT_TAGS $TODO); -$VERSION = '0.64'; +$VERSION = '0.64_02'; $VERSION = eval $VERSION; # make the alpha version come out as a number use Test::Builder::Module; @@ -41,7 +41,7 @@ Test::More - yet another framework for writing test scripts =head1 SYNOPSIS - use Test::More tests => $Num_Tests; + use Test::More tests => 23; # or use Test::More qw(no_plan); # or @@ -113,7 +113,7 @@ failure. The preferred way to do this is to declare a plan when you C. - use Test::More tests => $Num_Tests; + use Test::More tests => 23; There are rare cases when you will not know beforehand how many tests your script is going to run. In this case, you can declare that you @@ -1465,6 +1465,8 @@ This may cause problems: use Test::More use threads; +5.8.1 and above are supported. Anything below that has too many bugs. + =item Test::Harness upgrade diff --git a/lib/Test/Simple.pm b/lib/Test/Simple.pm index ae912d2..2edea47 100644 --- a/lib/Test/Simple.pm +++ b/lib/Test/Simple.pm @@ -4,7 +4,7 @@ use 5.004; use strict 'vars'; use vars qw($VERSION @ISA @EXPORT); -$VERSION = '0.64'; +$VERSION = '0.64_02'; $VERSION = eval $VERSION; # make the alpha version come out as a number use Test::Builder::Module; diff --git a/lib/Test/Simple/Changes b/lib/Test/Simple/Changes index 94491eb..433720d 100644 --- a/lib/Test/Simple/Changes +++ b/lib/Test/Simple/Changes @@ -1,3 +1,21 @@ +0.64_02 Sat Sep 9 12:16:56 EDT 2006 + - Last release broke Perls earlier than 5.8. + +0.64_01 Mon Sep 4 04:40:42 EDT 2006 + - Small improvement to the docs to avoid user confusion over + "use Test::More tests => $num_tests" (Thanks Eric Wilhelm) + - Minor fix for a test failure in is_deeply_fail for some Windows + users. Not a real bug. [rt.cpan.org 21310] + - _print_diag() accidentally leaked into the public documentation. + It is a private method. + * Made most of the error messages report in the caller's context. + [rt.cpan.org #20639] + * Made the failure diagnostic message file and line reporting portion + match Perl's for easier integration with Perl aware editors. + (so its "at $file line $line_num." now) + [rt.cpan.org #20639] + * 5.8.0 threads are no longer supported. There's too many bugs. + 0.64 Sun Jul 16 02:47:29 PDT 2006 * 0.63's change to test_fail() broke backwards compatibility. They have been removed for the time being. test_pass() went with it. diff --git a/lib/Test/Simple/t/00test_harness_check.t b/lib/Test/Simple/t/00test_harness_check.t index d50c8b5..262d53b 100644 --- a/lib/Test/Simple/t/00test_harness_check.t +++ b/lib/Test/Simple/t/00test_harness_check.t @@ -8,7 +8,7 @@ plan tests => 1; my $TH_Version = 2.03; require Test::Harness; -unless( cmp_ok( $Test::Harness::VERSION, '>', $TH_Version, "T::H version" ) ) { +unless( cmp_ok( $Test::Harness::VERSION, '>=', $TH_Version, "T::H version" ) ) { diag <= 5.008 && $Config{useithreads} ) { + if( $] >= 5.008001 && $Config{useithreads} ) { require threads; 'threads'->import; } diff --git a/lib/Test/Simple/t/extra.t b/lib/Test/Simple/t/extra.t index a005866..6a0082f 100644 --- a/lib/Test/Simple/t/extra.t +++ b/lib/Test/Simple/t/extra.t @@ -48,9 +48,9 @@ OUT $TB->is_eq($$err, <can(...)' -# in $0 at line 52. +# at $0 line 52. # Mooble::Hooble::Yooble->can('this') failed # Mooble::Hooble::Yooble->can('that') failed # Failed test 'Mooble::Hooble::Yooble->can(...)' -# in $0 at line 53. +# at $0 line 53. # can_ok() called with no methods # Failed test '->can(...)' -# in $0 at line 54. +# at $0 line 54. # can_ok() called with empty class or reference ERR @@ -162,16 +162,16 @@ isa_ok(undef, "Wibble", "Another Wibble"); isa_ok([], "HASH"); err_ok( <read, "/^$more_err_re/"); require_ok('ALL::YOUR::BASE::ARE::BELONG::TO::US::wibble'); $more_err_re = <builder->no_ending(1); fail( "this fails" ); err_ok( <{this} = '42' # \$expected->{this} = '43' @@ -99,7 +99,7 @@ is( $out, "not ok 4 - hashes with different keys\n", 'hashes with different keys' ); is( $err, <{this} = Does not exist # \$expected->{this} = '42' @@ -111,7 +111,7 @@ is( $out, "not ok 5 - arrays of different length\n", 'arrays of different length' ); is( $err, <[9] = Does not exist # \$expected->[9] = '10' @@ -122,7 +122,7 @@ ok !is_deeply([undef, undef], [undef], 'arrays of undefs' ); is( $out, "not ok 6 - arrays of undefs\n", 'arrays of undefs' ); is( $err, <[1] = undef # \$expected->[1] = Does not exist @@ -133,7 +133,7 @@ ok !is_deeply({ foo => undef }, {}, 'hashes of undefs' ); is( $out, "not ok 7 - hashes of undefs\n", 'hashes of undefs' ); is( $err, <{foo} = undef # \$expected->{foo} = Does not exist @@ -144,7 +144,7 @@ ok !is_deeply(\42, \23, 'scalar refs'); is( $out, "not ok 8 - scalar refs\n", 'scalar refs' ); is( $err, <{that}{foo} = Does not exist # \$expected->{that}{foo} = '42' @@ -252,7 +252,7 @@ $$err = $$out = ''; ok !is_deeply( [\'a', 'b'], [\'a', 'c'] ); is( $out, "not ok 20\n", 'scalar refs in an array' ); is( $err, <[1] = 'b' # \$expected->[1] = 'c' @@ -264,7 +264,7 @@ my $ref = \23; ok !is_deeply( 23, $ref ); is( $out, "not ok 21\n", 'scalar vs ref' ); is( $err, <[0] = $array # \$expected->[0] = $hash @@ -330,7 +330,7 @@ ERR ok !is_deeply( [$foo], [$bar] ); is( $out, "not ok 26\n", 'string overloaded refs respected in diag' ); is( $err, <[0] = $foo # \$expected->[0] = 'wibble' @@ -349,7 +349,7 @@ ERR ok !is_deeply( sub {"foo"}, sub {"bar"} ), 'function refs'; is( $out, "not ok 27\n" ); like( $err, < 8; use TieOut; -ok( !Test::Builder::_is_fh("foo"), 'string is not a filehandle' ); -ok( !Test::Builder::_is_fh(''), 'empty string' ); -ok( !Test::Builder::_is_fh(undef), 'undef' ); +ok( !Test::Builder->_is_fh("foo"), 'string is not a filehandle' ); +ok( !Test::Builder->_is_fh(''), 'empty string' ); +ok( !Test::Builder->_is_fh(undef), 'undef' ); ok( open(FILE, '>foo') ); END { close FILE; unlink 'foo' } -ok( Test::Builder::_is_fh(*FILE) ); -ok( Test::Builder::_is_fh(\*FILE) ); -ok( Test::Builder::_is_fh(*FILE{IO}) ); +ok( Test::Builder->_is_fh(*FILE) ); +ok( Test::Builder->_is_fh(\*FILE) ); +ok( Test::Builder->_is_fh(*FILE{IO}) ); tie *OUT, 'TieOut'; -ok( Test::Builder::_is_fh(*OUT) ); +ok( Test::Builder->_is_fh(*OUT) ); diff --git a/lib/Test/Simple/t/missing.t b/lib/Test/Simple/t/missing.t index e57cace..7912137 100644 --- a/lib/Test/Simple/t/missing.t +++ b/lib/Test/Simple/t/missing.t @@ -43,7 +43,7 @@ OUT My::Test::is($$err, < 6; -eval { - Test::Simple->import; -}; +my $tb = Test::Builder->create; +$tb->level(0); -My::Test::ok($$out eq ''); -My::Test::ok($$err eq ''); -My::Test::ok($@ eq ''); +#line 19 +ok !eval { $tb->plan(tests => undef) }; +is($@, "Got an undefined number of tests at $0 line 19.\n"); -eval { - Test::Simple->import(tests => undef); -}; +#line 23 +ok !eval { $tb->plan(tests => 0) }; +is($@, "You said to run 0 tests at $0 line 23.\n"); -My::Test::ok($$out eq ''); -My::Test::ok($$err eq ''); -My::Test::ok($@ =~ /Got an undefined number of tests/); - -eval { - Test::Simple->import(tests => 0); -}; - -My::Test::ok($$out eq ''); -My::Test::ok($$err eq ''); -My::Test::ok($@ =~ /You said to run 0 tests!/); - -eval { - Test::Simple::ok(1); -}; -My::Test::ok( $@ =~ /You tried to run a test without a plan!/); - - -END { - My::Test::ok($$out eq ''); - My::Test::ok($$err eq ""); - - # Prevent Test::Simple from exiting with non zero. - exit 0; -} +#line 27 +ok !eval { $tb->ok(1) }; +is( $@, "You tried to run a test without a plan at $0 line 27.\n"); diff --git a/lib/Test/Simple/t/plan.t b/lib/Test/Simple/t/plan.t index fa46744..0d3ce89 100644 --- a/lib/Test/Simple/t/plan.t +++ b/lib/Test/Simple/t/plan.t @@ -11,9 +11,11 @@ use Test::More; plan tests => 4; eval { plan tests => 4 }; -like( $@, '/^You tried to plan twice!/', 'disallow double plan' ); +is( $@, sprintf("You tried to plan twice at %s line %d.\n", $0, __LINE__ - 1), + 'disallow double plan' ); eval { plan 'no_plan' }; -like( $@, '/^You tried to plan twice!/', 'disallow chaning plan' ); +is( $@, sprintf("You tried to plan twice at %s line %d.\n", $0, __LINE__ -1), + 'disallow changing plan' ); pass('Just testing plan()'); pass('Testing it some more'); diff --git a/lib/Test/Simple/t/plan_bad.t b/lib/Test/Simple/t/plan_bad.t index cc1295a..d20797e 100644 --- a/lib/Test/Simple/t/plan_bad.t +++ b/lib/Test/Simple/t/plan_bad.t @@ -8,57 +8,27 @@ BEGIN { } -# Can't use Test.pm, that's a 5.005 thing. -package My::Test; +use Test::More tests => 10; +use Test::Builder; +my $tb = Test::Builder->create; +$tb->level(0); -print "1..7\n"; - -my $test_num = 1; -# Utility testing functions. -sub ok ($;$) { - my($test, $name) = @_; - my $ok = ''; - $ok .= "not " unless $test; - $ok .= "ok $test_num"; - $ok .= " - $name" if defined $name; - $ok .= "\n"; - print $ok; - $test_num++; - - return $test; -} - - -sub is ($$;$) { - my($this, $that, $name) = @_; - my $test = $this eq $that; - my $ok = ''; - $ok .= "not " unless $test; - $ok .= "ok $test_num"; - $ok .= " - $name" if defined $name; - $ok .= "\n"; - print $ok; - - unless( $test ) { - print "# got \n$this"; - print "# expected \n$that"; - } - $test_num++; - - return $test; -} - - -use Test::More import => ['plan']; - -ok !eval { plan tests => 'no_plan'; }; -is $@, "Number of tests must be a postive integer. You gave it 'no_plan'.\n"; +ok !eval { $tb->plan( tests => 'no_plan' ); }; +is $@, sprintf "Number of tests must be a positive integer. You gave it 'no_plan' at %s line %d.\n", $0, __LINE__ - 1; my $foo = []; my @foo = ($foo, 2, 3); -ok !eval { plan tests => @foo }; -is $@, "Number of tests must be a postive integer. You gave it '$foo'.\n"; +ok !eval { $tb->plan( tests => @foo ) }; +is $@, sprintf "Number of tests must be a positive integer. You gave it '$foo' at %s line %d.\n", $0, __LINE__ - 1; + +#line 25 +ok !eval { $tb->plan( tests => -1 ) }; +is $@, "Number of tests must be a positive integer. You gave it '-1' at $0 line 25.\n"; + +#line 29 +ok !eval { $tb->plan( tests => '' ) }; +is $@, "You said to run 0 tests at $0 line 29.\n"; -ok !eval { plan tests => 0 }; -ok !eval { plan tests => -1 }; -ok !eval { plan tests => '' }; +#line 33 +ok !eval { $tb->plan( 'wibble' ) }; +is $@, "plan() doesn't understand wibble at $0 line 33.\n"; diff --git a/lib/Test/Simple/t/skip.t b/lib/Test/Simple/t/skip.t index f2ea9fb..b7ec32a 100644 --- a/lib/Test/Simple/t/skip.t +++ b/lib/Test/Simple/t/skip.t @@ -94,5 +94,5 @@ SKIP: { pass "This does not run"; } - like $warning, qr/^skip\(\) was passed a non-numeric number of tests/; + like $warning, '/^skip\(\) was passed a non-numeric number of tests/'; } diff --git a/lib/Test/Simple/t/sort_bug.t b/lib/Test/Simple/t/sort_bug.t index aad806c..03e3df2 100644 --- a/lib/Test/Simple/t/sort_bug.t +++ b/lib/Test/Simple/t/sort_bug.t @@ -17,10 +17,10 @@ use strict; use Config; BEGIN { - unless ( $] >= 5.008 && $Config{'useithreads'} && + unless ( $] >= 5.008001 && $Config{'useithreads'} && eval { require threads; 'threads'->import; 1; }) { - print "1..0 # Skip: no threads\n"; + print "1..0 # Skip: no working threads\n"; exit 0; } } diff --git a/lib/Test/Simple/t/threads.t b/lib/Test/Simple/t/threads.t index 35696e2..42ba8c2 100644 --- a/lib/Test/Simple/t/threads.t +++ b/lib/Test/Simple/t/threads.t @@ -9,10 +9,10 @@ BEGIN { use Config; BEGIN { - unless ( $] >= 5.008 && $Config{'useithreads'} && + unless ( $] >= 5.008001 && $Config{'useithreads'} && eval { require threads; 'threads'->import; 1; }) { - print "1..0 # Skip: no threads\n"; + print "1..0 # Skip: no working threads\n"; exit 0; } }