From: Jarkko Hietaniemi Date: Sat, 14 Oct 2000 18:52:21 +0000 (+0000) Subject: Add test for bug id 20000427.003 (which seems to have X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=da450f52bd6555c7fd68afd19eff90c6c66c5641;p=p5sagit%2Fp5-mst-13.2.git Add test for bug id 20000427.003 (which seems to have been fixed) (also duplicate as 20000427.004, though with a higher severity). Move one utf8 from op/append to pragma/utf8, tag the tests with bug ids. p4raw-id: //depot/perl@7232 --- diff --git a/t/op/append.t b/t/op/append.t index 972d321..afaf6a1 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'; @@ -54,11 +54,3 @@ if ($_ eq 'abcdef') {print "ok 3\n";} else {print "not ok 3\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"; -} diff --git a/t/pragma/utf8.t b/t/pragma/utf8.t index 75f6ab3..953064c 100755 --- a/t/pragma/utf8.t +++ b/t/pragma/utf8.t @@ -10,7 +10,7 @@ BEGIN { } } -print "1..80\n"; +print "1..82\n"; my $test = 1; @@ -324,14 +324,18 @@ sub nok_bytes { } { - my($a,$b); - { use bytes; $a = "\xc3\xa4"; } - { use utf8; $b = "\xe4"; } - { use bytes; ok_bytes $a, $b; $test++; } # 69 - { use utf8; nok $a, $b; $test++; } # 70 + # bug id 20001009.001 + + my($a,$b); + { use bytes; $a = "\xc3\xa4"; } + { use utf8; $b = "\xe4"; } + { use bytes; ok_bytes $a, $b; $test++; } # 69 + { use utf8; nok $a, $b; $test++; } # 70 } { + # bug id 20001008.001 + my @x = ("stra\337e 138","stra\337e 138"); for (@x) { s/(\d+)\s*([\w\-]+)/$1 . uc $2/e; @@ -346,6 +350,8 @@ sub nok_bytes { } { + # bug id 20000819.004 + $_ = $dx = "\x{10f2}"; s/($dx)/$dx$1/; { @@ -376,6 +382,8 @@ sub nok_bytes { } { + # bug id 20000323.056 + use utf8; print "not " unless "\x{41}" eq +v65; @@ -398,3 +406,34 @@ sub nok_bytes { print "ok $test\n"; $test++; } + +{ + # bug id 20000427.003 + + use utf8; + use warnings; + use strict; + + my $sushi = "\x{b36c}\x{5a8c}\x{ff5b}\x{5079}\x{505b}"; + + my @charlist = split //, $sushi; + my $r = ''; + foreach my $ch (@charlist) { + $r = $r . " " . sprintf "U+%04X", ord($ch); + } + + print "not " unless $r eq " U+B36C U+5A8C U+FF5B U+5079 U+505B"; + 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++; +}