summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarl Williamson <public@khwilliamson.com>2012-01-15 11:21:25 -0700
committerKarl Williamson <public@khwilliamson.com>2012-01-21 10:02:52 -0700
commit6cf0b5678c6f2ad5dad993e844b20fde2f63bb83 (patch)
treea9cc53d6dee6165681f7dc8c648de7cabb92c6df
parentfdf053ee47ea9986e50057289304565de43efda8 (diff)
downloadperl-6cf0b5678c6f2ad5dad993e844b20fde2f63bb83.tar.gz
locale.t: Remove hard-coded test number
The subroutine with the hard-coded value used to forward reference the number of tests is no longer needed, as this and previous commits move the place where the number is needed to afterwards.
-rw-r--r--lib/locale.t10
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/locale.t b/lib/locale.t
index 89a87ab923..d181f256a6 100644
--- a/lib/locale.t
+++ b/lib/locale.t
@@ -56,7 +56,6 @@ $have_setlocale = 0 if ((($^O eq 'MSWin32' && !$winxp) || $^O eq 'NetWare') &&
# UWIN seems to loop after taint tests, just skip for now
$have_setlocale = 0 if ($^O =~ /^uwin/);
-my $last_locales = $have_setlocale ? &last_locales : &last_without_setlocale;
sub LC_ALL ();
$a = 'abc %';
@@ -249,8 +248,6 @@ check_taint_not $2;
check_taint_not $a;
-sub last_without_setlocale { 98 }
-
# I think we've seen quite enough of taint.
# Let us do some *real* locale work now,
# unless setlocale() is missing (i.e. minitest).
@@ -260,6 +257,9 @@ unless ($have_setlocale) {
exit;
}
+# The test number before our first setlocale()
+my $last_without_setlocale = $test_num;
+
# Find locales.
debug "# Scanning for locales...\n";
@@ -834,9 +834,11 @@ foreach $Locale (@Locale) {
}
}
+my $last_locales = $have_setlocale ? &last_locales : $last_without_setlocale;
+
# Recount the errors.
-foreach (&last_without_setlocale()+1..$last_locales) {
+foreach ($last_without_setlocale+1..$last_locales) {
if ($Problem{$_} || !defined $Okay{$_} || !@{$Okay{$_}}) {
if ($_ == 102) {
print "# The failure of test 102 is not necessarily fatal.\n";