From fdf053ee47ea9986e50057289304565de43efda8 Mon Sep 17 00:00:00 2001 From: Karl Williamson Date: Sun, 15 Jan 2012 11:16:57 -0700 Subject: locale.t: Move test plan to end The current code goes through a lot of machinations to know 1..n at the beginning. Nowadays, one can simply calculate this as we go along and print it out at the end. If the test fails in the middle, the lack of a plan will be marked as a failure. --- lib/locale.t | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/lib/locale.t b/lib/locale.t index 690a17387b..89a87ab923 100644 --- a/lib/locale.t +++ b/lib/locale.t @@ -57,10 +57,6 @@ $have_setlocale = 0 if ((($^O eq 'MSWin32' && !$winxp) || $^O eq 'NetWare') && $have_setlocale = 0 if ($^O =~ /^uwin/); my $last_locales = $have_setlocale ? &last_locales : &last_without_setlocale; -my $last = $have_setlocale ? &last : &last_without_setlocale; - -print "1..$last\n"; - sub LC_ALL (); $a = 'abc %'; @@ -259,7 +255,10 @@ sub last_without_setlocale { 98 } # Let us do some *real* locale work now, # unless setlocale() is missing (i.e. minitest). -exit unless $have_setlocale; +unless ($have_setlocale) { + print "1..$test_num\n"; + exit; +} # Find locales. @@ -1007,6 +1006,6 @@ setlocale(LC_ALL, "C"); } -sub last { 165 } +print "1..$test_num\n"; # eof -- cgit v1.2.1