}
use strict;
+use feature 'fc';
-my $debug = 1;
+my $debug = 0;
use Dumpvalue;
check_taint ucfirst($a);
check_taint "\u$a";
check_taint lc($a);
+check_taint fc($a);
check_taint "\L$a";
+check_taint "\F$a";
check_taint lcfirst($a);
check_taint "\l$a";
check_taint_not ucfirst($a);
check_taint_not "\u$a";
check_taint_not lc($a);
+ check_taint_not fc($a);
check_taint_not "\L$a";
+ check_taint_not "\F$a";
check_taint_not lcfirst($a);
check_taint_not "\l$a";
# With utf8 both will fail since the locale concept
# of upper/lower does not work well in Unicode.
push @f, $x unless $x =~ /$y/i == $y =~ /$x/i;
+
+ # fc is not a locale concept, so Perl uses lc for it.
+ push @f, $x unless lc $x eq fc $x;
}
else {
use locale ':not_characters';
# Here, we can fully test things, unlike plain 'use locale',
# because this form does work well with Unicode
push @f, $x unless $x =~ /$y/i && $y =~ /$x/i;
+
+ # The places where Unicode's lc is different from fc are
+ # skipped here by virtue of the 'next unless uc...' line above
+ push @f, $x unless lc $x eq fc $x;
}
}
# With utf8 both will fail since the locale concept
# of upper/lower does not work well in Unicode.
push @f, $x unless $x =~ /$y/i == $y =~ /$x/i;
+
+ push @f, $x unless lc $x eq fc $x;
}
else {
use locale ':not_characters';
$x =~ /$y/i ? 1 : 0, " ",
$y =~ /$x/i ? 1 : 0, "\n" if 0;
push @f, $x unless $x =~ /$y/i && $y =~ /$x/i;
+
+ push @f, $x unless lc $x eq fc $x;
}
}
tryneoalpha($Locale, $locales_test_number, @f == 0);
use locale;
use feature 'unicode_strings';
- foreach my $function ("uc", "ucfirst", "lc", "lcfirst") {
+ foreach my $function ("uc", "ucfirst", "lc", "lcfirst", "fc") {
my @list; # List of code points to test for $function
# Used to calculate the changed case for ASCII characters by using the
? lc($char)
: ($function eq "lcfirst")
? lcfirst($char)
+ : ($function eq "fc")
+ ? fc($char)
: die("Unexpected function \"$function\"");
}
else {
? lc($char)
: ($function eq "lcfirst")
? lcfirst($char)
+ : ($function eq "fc")
+ ? fc($char)
: die("Unexpected function \"$function\"");
}
ok($changed eq $should_be,