This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
In utf8decode.t, test that the hex sequences and \x escapes are equivalent.
authorNicholas Clark <nick@ccl4.org>
Sat, 12 Mar 2011 11:45:52 +0000 (11:45 +0000)
committerNicholas Clark <nick@ccl4.org>
Sat, 12 Mar 2011 14:30:09 +0000 (14:30 +0000)
The hex sequences had been in the test data since they were first added in
ba210ebec161cde0, but have never actually been used, other than for a length
cross-check.

t/op/utf8decode.t

index 52dbd58..95773bb 100644 (file)
@@ -153,6 +153,8 @@ __EOMK__
                ($2, $3, $4, $5, $6, $7, $8);
            my @hex = split(/:/, $hex);
            is(scalar @hex, $byteslen, 'Amount of hex tallies with byteslen');
+           my $fromhex = join '', map {chr hex $_} @hex;
+           is($fromhex, $bytes, 'hex matches bytes');
            {
                use bytes;
                my $bytesbyteslen = length($bytes);