From: Jarkko Hietaniemi Date: Tue, 5 Dec 2000 23:09:54 +0000 (+0000) Subject: Continue utf8 dispersal. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=bdaa056b11e48cf62d10e60a3fb881684257f1fc;p=p5sagit%2Fp5-mst-13.2.git Continue utf8 dispersal. p4raw-id: //depot/perl@8004 --- diff --git a/MANIFEST b/MANIFEST index 03be963..8e0040f 100644 --- a/MANIFEST +++ b/MANIFEST @@ -1494,6 +1494,7 @@ t/op/chars.t See if character escapes work t/op/chop.t See if chop works t/op/closure.t See if closures work t/op/cmp.t See if the various string and numeric compare work +t/op/concat.t See if string concatenation works t/op/cond.t See if conditional expressions work t/op/context.t See if context propagation works t/op/defins.t See if auto-insert of defined() works diff --git a/t/op/concat.t b/t/op/concat.t new file mode 100644 index 0000000..76074e0 --- /dev/null +++ b/t/op/concat.t @@ -0,0 +1,100 @@ +#!./perl + +BEGIN { + chdir 't' if -d 't'; + @INC = '../lib'; +} + +print "1..11\n"; + +($a, $b, $c) = qw(foo bar); + +print "not " unless "$a" eq "foo"; +print "ok 1\n"; + +print "not " unless "$a$b" eq "foobar"; +print "ok 2\n"; + +print "not " unless "$c$a$c" eq "foo"; +print "ok 3\n"; + +# Okay, so that wasn't very challenging. Let's go Unicode. + +my $test = 4; + +{ + # bug id 20000819.004 + + $_ = $dx = "\x{10f2}"; + s/($dx)/$dx$1/; + { + use bytes; + print "not " unless $_ eq "$dx$dx"; + print "ok $test\n"; + $test++; + } + + $_ = $dx = "\x{10f2}"; + s/($dx)/$1$dx/; + { + use bytes; + print "not " unless $_ eq "$dx$dx"; + print "ok $test\n"; + $test++; + } + + $dx = "\x{10f2}"; + $_ = "\x{10f2}\x{10f2}"; + s/($dx)($dx)/$1$2/; + { + use bytes; + print "not " unless $_ eq "$dx$dx"; + print "ok $test\n"; + $test++; + } +} + +{ + # bug id 20000901.092 + # test that undef left and right of utf8 results in a valid string + + my $a; + $a .= "\x{1ff}"; + print "not " unless $a eq "\x{1ff}"; + print "ok $test\n"; + $test++; +} + +{ + # ID 20001020.006 + + "x" =~ /(.)/; # unset $2 + + # Without the fix this 5.7.0 would croak: + # Modification of a read-only value attempted at ... + "$2\x{1234}"; + + print "ok $test\n"; + $test++; + + # For symmetry with the above. + "\x{1234}$2"; + + print "ok $test\n"; + $test++; + + *pi = \undef; + # 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 ... + "$pi\x{1234}"; + + print "ok $test\n"; + $test++; + + # For symmetry with the above. + "\x{1234}$pi"; + + print "ok $test\n"; + $test++; +} diff --git a/t/pragma/utf8.t b/t/pragma/utf8.t index 8efd571..660ffef 100755 --- a/t/pragma/utf8.t +++ b/t/pragma/utf8.t @@ -10,7 +10,7 @@ BEGIN { } } -print "1..103\n"; +print "1..95\n"; my $test = 1; @@ -354,38 +354,6 @@ sub nok_bytes { } { - # bug id 20000819.004 - - $_ = $dx = "\x{10f2}"; - s/($dx)/$dx$1/; - { - use bytes; - print "not " unless $_ eq "$dx$dx"; - print "ok $test\n"; - $test++; - } - - $_ = $dx = "\x{10f2}"; - s/($dx)/$1$dx/; - { - use bytes; - print "not " unless $_ eq "$dx$dx"; - print "ok $test\n"; - $test++; - } - - $dx = "\x{10f2}"; - $_ = "\x{10f2}\x{10f2}"; - s/($dx)($dx)/$1$2/; - { - use bytes; - print "not " unless $_ eq "$dx$dx"; - print "ok $test\n"; - $test++; - } -} - -{ # bug id 20000323.056 print "not " unless "\x{41}" eq +v65; @@ -430,17 +398,6 @@ sub nok_bytes { } { - # bug id 20000901.092 - # test that undef left and right of utf8 results in a valid string - - my $a; - $a .= "\x{1ff}"; - print "not " unless $a eq "\x{1ff}"; - print "ok $test\n"; - $test++; -} - -{ # bug id 20000426.003 use utf8; @@ -527,37 +484,3 @@ sub nok_bytes { $test++; } } - -{ - # ID 20001020.006 - - "x" =~ /(.)/; # unset $2 - - # Without the fix this will croak: - # Modification of a read-only value attempted at ... - "$2\x{1234}"; - - print "ok $test\n"; - $test++; - - # For symmetry with the above. - "\x{1234}$2"; - - print "ok $test\n"; - $test++; - - *pi = \undef; - # This bug existed earlier than the $2 bug, but is fixed with the same - # patch. Without the fix this will also croak: - # Modification of a read-only value attempted at ... - "$pi\x{1234}"; - - print "ok $test\n"; - $test++; - - # For symmetry with the above. - "\x{1234}$pi"; - - print "ok $test\n"; - $test++; -}