This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Upgrade Digest::MD5 from version 2.40 to 2.50
[perl5.git] / cpan / Digest-MD5 / t / utf8.t
index 6cf68b7..cb53f57 100644 (file)
@@ -7,7 +7,7 @@ BEGIN {
     }
 }
 
-print "1..3\n";
+print "1..5\n";
 
 use strict;
 use Digest::MD5 qw(md5_hex);
@@ -33,3 +33,21 @@ print "ok 2\n";
 # reference
 print "not " unless md5_hex("foo\xFF") eq $exp;
 print "ok 3\n";
+
+# autopromotion
+if ($] >= 5.007003) {
+
+my $unistring = "Oslo.pm har sosialt medlemsmøte onsdag 1. April 2008, klokken 18:30. Vi treffes på Marhaba Café, Keysersgate 1.";
+
+require Encode;
+$unistring = Encode::decode_utf8($unistring);
+print "not " if ( not utf8::is_utf8($unistring));
+print "ok 4\n";
+
+md5_hex($unistring, "");
+print "not " if ( not utf8::is_utf8($unistring));
+print "ok 5\n"
+
+} else {
+    print "ok 4 # SKIP Your perl is too old to properly test unicode semantics\nok 5 # SKIP No, really\n";
+}