concat.t revision 7c478bd95313f5f23a4c958a745db2134aa03244
#!./perl
BEGIN {
chdir 't' if -d 't';
}
# This ok() function is specially written to avoid any concatenation.
my $test = 1;
sub ok {
$test++;
return $ok;
}
print "1..28\n";
# Okay, so that wasn't very challenging. Let's go Unicode.
{
# bug id 20000819.004
{
}
{
}
$_ = "\x{10f2}\x{10f2}";
{
}
}
{
# bug id 20000901.092
# test that undef left and right of utf8 results in a valid string
my $a;
$a .= "\x{1ff}";
$a .= undef;
}
{
# ID 20001020.006
"x" =~ /(.)/; # unset $2
# Without the fix this 5.7.0 would croak:
# Modification of a read-only value attempted at ...
eval {"$2\x{1234}"};
# For symmetry with the above.
eval {"\x{1234}$2"};
# This bug existed earlier than the $2 bug, but is fixed with the same
# patch. Without the fix this 5.7.0 would also croak:
# Modification of a read-only value attempted at ...
# For symmetry with the above.
}
{
# concat should not upgrade its arguments.
my($l, $r, $c);
($l, $r, $c) = ("\x{101}", "\x{fe}", "\x{101}\x{fe}");
($l, $r, $c) = ("\x{fe}", "\x{101}", "\x{fe}\x{101}");
}
{
my $a; ($a .= 5) . 6;
}
{
# [perl #24508] optree construction bug
my ($x, $y);
}
{
# [perl #26905] "use bytes" doesn't apply byte semantics to concatenation
my $u = "\x{100}";
my $x1 = $p;
my $y1 = $u;
use bytes;
$x1 .= $u;
$x2 = $p . $u;
$y1 .= $p;
$y2 = $u . $p;
}