X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Fop%2Fappend.t;h=5e70659c07a6930a5fbfe20d425d49761f1a6a24;hb=95e8664e86da93255f26600f44bbbd70bf5b5b0e;hp=972d32178bbfe9c3944d9de6e8f0f78d0b74f6af;hpb=5fa9e1699857f48f424aaf1b7c26bcdffdf16a76;p=p5sagit%2Fp5-mst-13.2.git diff --git a/t/op/append.t b/t/op/append.t index 972d321..5e70659 100755 --- a/t/op/append.t +++ b/t/op/append.t @@ -2,7 +2,7 @@ # $RCSfile: append.t,v $$Revision: 4.1 $$Date: 92/08/07 18:27:36 $ -print "1..14\n"; +print "1..13\n"; $a = 'ab' . 'c'; # compile time $b = 'def'; @@ -35,30 +35,46 @@ 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"); +# Character 'b' occurs at codepoint 130 decimal or \202 octal +# under an EBCDIC coded character set. +# my($a, $ab) = ("a", "a\000b"); + my($a, $ab) = ("\141", "\141\000\142"); my($u, $ub) = map pack("U0a*", $_), $a, $ab; my $t1 = $a; $t1 .= $ab; - print $t1 =~ /b/ ? "ok 6\n" : "not ok 6\t# $t1\n"; + print $t1 =~ /\142/ ? "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"; + if (ord('A') == 193) { + # print $t2 eq "\141\141\000" ? "ok 7\n" : "not ok 7\t# $t2\n"; + print $t2 =~ /\141/ ? "ok 7\n" : "not ok 7\t# $t2\n"; + } + else { + print $t2 =~ /\142/ ? "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"; + print $t3 =~ /\142/ ? "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"; + if (ord('A') == 193) { + print $t4 =~ /\141/ ? "ok 9\n" : "not ok 9\t# $t4\n"; + } + else { + print $t4 =~ /\142/ ? "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"; + print $t5 =~ /\142/ ? "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"; + if (ord('A') == 193) { + print $t6 =~ /\141/ ? "ok 11\n" : "not ok 11\t# $t6\n"; + } + else { + print $t6 =~ /\142/ ? "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"; + print $t7 =~ /\142/ ? "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"; -} - -# test that undef left and right of utf8 results in a valid string -{ - my $a; - $a .= "\x{1ff}"; - print $a eq "\x{1ff}" ? "ok 14\n" : - "not ok 14\t# (undef.0x1ff) ne (0x1ff)\n"; + if (ord('A') == 193) { + print $t8 =~ /\141/ ? "ok 13\n" : "not ok 13\t# $t8\n"; + } + else { + print $t8 =~ /\142/ ? "ok 13\n" : "not ok 13\t# $t8\n"; + } }