From: Jarkko Hietaniemi Date: Wed, 10 Jan 2001 20:41:37 +0000 (+0000) Subject: Test for bug id 20010105.016 (fixed by #8378). X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=974f237af9a53a4c10de7d504c982c930b7d3c39;p=p5sagit%2Fp5-mst-13.2.git Test for bug id 20010105.016 (fixed by #8378). p4raw-id: //depot/perl@8395 --- diff --git a/t/op/split.t b/t/op/split.t index 90c38e0..ffc29be 100755 --- a/t/op/split.t +++ b/t/op/split.t @@ -1,6 +1,6 @@ #!./perl -print "1..30\n"; +print "1..32\n"; $FS = ':'; @@ -129,6 +129,27 @@ print "not" if $_ ne "r:m :b"; print "ok 29\n"; # unicode splittage + @ary = map {ord} split //, v1.20.300.4000.50000.4000.300.20.1; print "not " unless "@ary" eq "1 20 300 4000 50000 4000 300 20 1"; print "ok 30\n"; + +@ary = split(/\x{FE}/, "\x{FF}\x{FE}\x{FD}"); # bug id 20010105.016 +print "not " unless @ary == 2 && + $ary[0] eq "\xFF" && $ary[1] eq "\xFD" && + $ary[0] eq "\x{FF}" && $ary[1] eq "\x{FD}"; +print "ok 31\n"; + +@ary = split(/(\x{FE}\xFE)/, "\xFF\x{FF}\xFE\x{FE}\xFD\x{FD}"); # variant of 31 +print "not " unless @ary == 3 && + $ary[0] eq "\xFF\xFF" && + $ary[0] eq "\x{FF}\xFF" && + $ary[0] eq "\x{FF}\x{FF}" && + $ary[1] eq "\xFE\xFE" && + $ary[1] eq "\x{FE}\xFE" && + $ary[1] eq "\x{FE}\x{FE}" && + $ary[2] eq "\xFD\xFD" && + $ary[2] eq "\x{FD}\xFD" && + $ary[2] eq "\x{FD}\x{FD}"; + +print "ok 32\n";