From: Jarkko Hietaniemi Date: Sat, 24 Feb 2001 16:38:12 +0000 (+0000) Subject: Add a test for the "character range should match in EBCDIC X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=b485d0510a038735eb089728415ee23b7dc90a29;p=p5sagit%2Fp5-mst-13.2.git Add a test for the "character range should match in EBCDIC if specified using explicit numerics" bug found by Karsten Sperling. p4raw-id: //depot/perl@8922 --- diff --git a/t/op/pat.t b/t/op/pat.t index d7eb9f8..237ea44 100755 --- a/t/op/pat.t +++ b/t/op/pat.t @@ -4,7 +4,7 @@ # the format supported by op/regexp.t. If you want to add a test # that does fit that format, add it to op/re_tests, not here. -print "1..240\n"; +print "1..242\n"; BEGIN { chdir 't' if -d 't'; @@ -1182,3 +1182,24 @@ if (/(\C)/g) { print "not ok $_\n"; } } + +# 241..242 +# +# The tr is admittedly NOT a regular expression operator, +# but this test is more of an EBCDIC test, the background is +# that \x89 is 'i' and \x90 is 'j', and \x8e is not a letter, +# not even a printable character. Now for the trick: +# if the range is specified using letters, the \x8e should most +# probably not match, but if the range is specified using explicit +# numeric endpoints, it probably should match. The first case, +# not matching if using letters, is already tested elsewhere, +# here we test for the matching cases. + +$_ = qq/\x8E/; + +print "not " unless /[\x89-\x91]/; +print "ok 241\n"; + +print "not " unless tr/\x89-\x91//d == 1; +print "ok 242\n"; +