X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2Futf8.t;h=70ef1e3294280325d63feaebccd2a01a0080ba6b;hb=d0c833c6b6d161774fa9ee0c74b6748675c48591;hp=33cd5966af572a7d2c878b00df5f5b03ea734dab;hpb=6e37fd2a54b1a286397ea047abb89aad1f47cd8d;p=p5sagit%2Fp5-mst-13.2.git diff --git a/lib/utf8.t b/lib/utf8.t index 33cd596..70ef1e3 100644 --- a/lib/utf8.t +++ b/lib/utf8.t @@ -37,7 +37,7 @@ no utf8; # Ironic, no? # # -plan tests => 143; +plan tests => 146; { # bug id 20001009.001 @@ -409,3 +409,25 @@ SKIP: { ok( utf8::is_utf8($b), " utf8::is_utf8 beyond"); # $b stays in UTF-8. ok( utf8::is_utf8($c), " utf8::is_utf8 unicode"); } + +{ + eval {utf8::encode("£")}; + like($@, qr/^Modification of a read-only value attempted/, + "utf8::encode should refuse to touch read-only values"); +} + +{ + my $a = "456\xb6"; + utf8::upgrade($a); + + my $b = "123456\xb6"; + $b =~ s/^...//; + utf8::upgrade($b); + is($b, $a, "utf8::upgrade OffsetOK"); +} + +{ + fresh_perl_like ('use utf8; utf8::moo()', + qr/Undefined subroutine utf8::moo/, {stderr=>1}, + "Check Carp is loaded for AUTOLOADing errors") +}