Sync with libnet-1.11
[p5sagit/p5-mst-13.2.git] / lib / utf8.t
index ee3c258..19d88e5 100644 (file)
@@ -145,7 +145,7 @@ plan tests => 94;
              # Now we do the real byte sequences that are valid UTF8
              (map {
                ["the utf8 sequence for chr $_->[0]",
-                qq(\$a = "$_->[1]"; \$b = show \$a), qr/^>$_->[2]<$/],
+                qq{\$a = "$_->[1]"; \$b = show \$a}, qr/^>$_->[2]<$/],
                ["no utf8; for the utf8 sequence for chr $_->[0]",
                 qq(no utf8; \$a = "$_->[1]"; \$b = show \$a), qr/^>$_->[2]<$/],
                ["use utf8; for the utf8 sequence for chr $_->[0]",
@@ -159,12 +159,13 @@ plan tests => 94;
     use utf8; %a = ("\xE1\xA0"=>"sterling");
     print 'start'; printf '%x,', ord \$_ foreach keys %a; print "end\n";
 BANG
-             qr/^Malformed UTF-8 character \(2 bytes, need 3\).*start\d+,end$/s
+             qr/^Malformed UTF-8 character \(2 bytes, need 3.+\).*start\d+,end$/s
             ],
             );
     foreach (@tests) {
         my ($why, $prog, $expect) = @$_;
         open P, ">$progfile" or die "Can't open '$progfile': $!";
+        binmode(P, ":bytes");
        print P $show, $prog, '; print $b'
             or die "Print to 'progfile' failed: $!";
         close P or die "Can't close '$progfile': $!";