In perl.git, the branch blead has been updated <http://perl5.git.perl.org/perl.git/commitdiff/c45bec600218d6ecc7bbf7c5d04a7ecbe709d9a2?hp=273be65c18c94ccde36c8a6d14c992ff7434681a>
- Log ----------------------------------------------------------------- commit c45bec600218d6ecc7bbf7c5d04a7ecbe709d9a2 Author: Nicholas Clark <[email protected]> Date: Sat Mar 12 18:11:56 2011 +0000 Convert t/op/utf8cache.t to test.pl, strict and warnings. M t/op/utf8cache.t commit 2929db82f967aeec892b330c14b41874f1d2a329 Author: Nicholas Clark <[email protected]> Date: Sat Mar 12 18:08:24 2011 +0000 skip_all_without_dynamic_extension() should accepted names containing ::s Whilst the package separator is a double colon, config.sh ends up using a / for the package separator, reflecting how, historically, extensions were laid out in nested directories beneath ext/. The layout has changed, but the convention in the config.sh entries, and hence the %Config::Config values, remains the same. Hence skip_all_without_dynamic_extension() needs to convert passed-in ::s to / before performing a lookup. M t/test.pl ----------------------------------------------------------------------- Summary of changes: t/op/utf8cache.t | 18 +++++++----------- t/test.pl | 1 + 2 files changed, 8 insertions(+), 11 deletions(-) diff --git a/t/op/utf8cache.t b/t/op/utf8cache.t index df04f54..7ac0011 100644 --- a/t/op/utf8cache.t +++ b/t/op/utf8cache.t @@ -1,17 +1,16 @@ -#!./perl +#!./perl -w # Test for malfunctions of utf8 cache BEGIN { chdir 't' if -d 't'; @INC = '../lib'; + require './test.pl'; + skip_all_without_dynamic_extension('Devel::Peek'); } -unless (eval { require Devel::Peek }) { - print "# Without Devel::Peek, never mind\n"; - print "1..0\n"; - exit; -} -print "1..1\n"; +use strict; + +plan(tests => 1); my $pid = open CHILD, '-|'; die "kablam: $!\n" unless defined $pid; @@ -35,7 +34,4 @@ my $utf8magic = qr{ ^ \s+ MAGIC \s = .* \n \s+ MG_TYPE \s = \s PERL_MAGIC_utf8 .* \n \s+ MG_LEN \s = .* \n }xm; -if (m{ $utf8magic $utf8magic }x) { - print "not "; -} -print "ok 1\n"; +unlike($_, qr{ $utf8magic $utf8magic }x); diff --git a/t/test.pl b/t/test.pl index 21bf1d2..d83f69b 100644 --- a/t/test.pl +++ b/t/test.pl @@ -129,6 +129,7 @@ sub skip_all_without_dynamic_extension { warn "test.pl had problems loading Config: $@"; return; } + $extension =~ s!::!/!g; return if ($Config::Config{extensions} =~ /\b$extension\b/); skip_all("$extension was not built"); } -- Perl5 Master Repository
