X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Fop%2Fappend.t;h=21af62c38e2b232c4847a14320b0779ea5baa039;hb=d279ab826c469db5d93d3d728fdcf1acd9265665;hp=afaf6a1d41ce23c8390eb613d184725c07eb877a;hpb=da450f52bd6555c7fd68afd19eff90c6c66c5641;p=p5sagit%2Fp5-mst-13.2.git diff --git a/t/op/append.t b/t/op/append.t index afaf6a1..21af62c 100755 --- a/t/op/append.t +++ b/t/op/append.t @@ -1,7 +1,5 @@ #!./perl -# $RCSfile: append.t,v $$Revision: 4.1 $$Date: 92/08/07 18:27:36 $ - print "1..13\n"; $a = 'ab' . 'c'; # compile time @@ -35,22 +33,40 @@ if ($_ eq 'abcdef') {print "ok 3\n";} else {print "not ok 3\n";} # test that nul bytes get copied { - my($a, $ab) = ("a", "a\000b"); - my($u, $ub) = map pack("U0a*", $_), $a, $ab; + my ($a, $ab) = ("a", "a\0b"); + my ($ua, $uab) = map pack("U0a*", $_), $a, $ab; + + my $ub = pack("U0a*", 'b'); + my $t1 = $a; $t1 .= $ab; + print $t1 =~ /b/ ? "ok 6\n" : "not ok 6\t# $t1\n"; - my $t2 = $a; $t2 .= $ub; - print $t2 =~ /b/ ? "ok 7\n" : "not ok 7\t# $t2\n"; - my $t3 = $u; $t3 .= $ab; - print $t3 =~ /b/ ? "ok 8\n" : "not ok 8\t# $t3\n"; - my $t4 = $u; $t4 .= $ub; - print $t4 =~ /b/ ? "ok 9\n" : "not ok 9\t# $t4\n"; + + my $t2 = $a; $t2 .= $uab; + + print eval '$t2 =~ /$ub/' ? "ok 7\n" : "not ok 7\t# $t2\n"; + + my $t3 = $ua; $t3 .= $ab; + + print $t3 =~ /$ub/ ? "ok 8\n" : "not ok 8\t# $t3\n"; + + my $t4 = $ua; $t4 .= $uab; + + print eval '$t4 =~ /$ub/' ? "ok 9\n" : "not ok 9\t# $t4\n"; + my $t5 = $a; $t5 = $ab . $t5; - print $t5 =~ /b/ ? "ok 10\n" : "not ok 10\t# $t5\n"; - my $t6 = $a; $t6 = $ub . $t6; - print $t6 =~ /b/ ? "ok 11\n" : "not ok 11\t# $t6\n"; - my $t7 = $u; $t7 = $ab . $t7; - print $t7 =~ /b/ ? "ok 12\n" : "not ok 12\t# $t7\n"; - my $t8 = $u; $t8 = $ub . $t8; - print $t8 =~ /b/ ? "ok 13\n" : "not ok 13\t# $t8\n"; + + print $t5 =~ /$ub/ ? "ok 10\n" : "not ok 10\t# $t5\n"; + + my $t6 = $a; $t6 = $uab . $t6; + + print eval '$t6 =~ /$ub/' ? "ok 11\n" : "not ok 11\t# $t6\n"; + + my $t7 = $ua; $t7 = $ab . $t7; + + print $t7 =~ /$ub/ ? "ok 12\n" : "not ok 12\t# $t7\n"; + + my $t8 = $ua; $t8 = $uab . $t8; + + print eval '$t8 =~ /$ub/' ? "ok 13\n" : "not ok 13\t# $t8\n"; }