This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Convert t/op/utf8cache.t to test.pl, strict and warnings.
authorNicholas Clark <nick@ccl4.org>
Sat, 12 Mar 2011 18:11:56 +0000 (18:11 +0000)
committerNicholas Clark <nick@ccl4.org>
Sat, 12 Mar 2011 18:11:56 +0000 (18:11 +0000)
t/op/utf8cache.t

index df04f54..7ac0011 100644 (file)
@@ -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);