From a8c75f4be1d24785526e639ef648a2b7906a61cc Mon Sep 17 00:00:00 2001 From: Karl Williamson Date: Sat, 4 Jun 2011 14:41:25 -0600 Subject: [PATCH] Add tests for [perl #87908] --- t/re/reg_posixcc.t | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/t/re/reg_posixcc.t b/t/re/reg_posixcc.t index aa7f445..d37411b 100644 --- a/t/re/reg_posixcc.t +++ b/t/re/reg_posixcc.t @@ -97,6 +97,20 @@ while (@pats) { $got{"[$no]"}{$type} = $str=~/[$no]/ ? 1 : 0; $got{"[^$yes]"}{$type} = $str=~/[^$yes]/ ? 1 : 0; $got{"[^$no]"}{$type} = $str=~/[^$no]/ ? 1 : 0; + + # For \w, \s, and \d, also test without being in character + # classes. + next if $yes =~ /\[/; + + # The rest of this .t was written when there were many test + # failures, so it goes to some lengths to summarize things. Now + # those are fixed, so these missing tests just do standard + # procedures + + my $chr = chr($b); + utf8::upgrade $chr if $type eq 'unicode'; + ok (($chr =~ /$yes/) != ($chr =~ /$no/), + "$type: chr($display_b) isn't both $yes and $no"); } foreach my $which ("[$yes]","[$no]","[^$yes]","[^$no]") { if ($got{$which}{'unicode'} != $got{$which}{'not-unicode'}){ -- 2.7.4