In perl.git, the branch blead has been updated <http://perl5.git.perl.org/perl.git/commitdiff/3d243db0aa7e1e3c1c03a9baa9710b811029a73e?hp=c8dbf8cd68001653e6c7552aa8f11f0b9e504e3f>
- Log ----------------------------------------------------------------- commit 3d243db0aa7e1e3c1c03a9baa9710b811029a73e Author: karl williamson (via RT) <[email protected]> Date: Tue Jul 6 08:27:34 2010 -0700 PATCH: t/lib/common.pl localized $/ setting; allow input 'no_plan' # New Ticket Created by karl williamson # Please include the string: [perl #76398] # in the subject line of all future correspondence about this issue. # <URL: http://rt.perl.org/rt3/Ticket/Display.html?id=76398 > See attached patches >From 275169a8df5851331669da2dd791483379c3fc5e Mon Sep 17 00:00:00 2001 From: Karl Williamson <k...@khw-desktop.(none)> Date: Tue, 6 Jul 2010 09:20:42 -0600 Subject: [PATCH] t/lib/common.pl: localize changing $/ $/ changes should not affect callers. Signed-off-by: H.Merijn Brand <[email protected]> ----------------------------------------------------------------------- Summary of changes: t/lib/common.pl | 10 ++++++++-- 1 files changed, 8 insertions(+), 2 deletions(-) diff --git a/t/lib/common.pl b/t/lib/common.pl index e5c9af4..e68a351 100644 --- a/t/lib/common.pl +++ b/t/lib/common.pl @@ -1,5 +1,9 @@ # This code is used by lib/charnames.t, lib/feature.t, lib/subs.t, # lib/strict.t and lib/warnings.t +# +# On input, $::local_tests is the number of tests in the caller; or +# 'no_plan' if unknown, in which case it is the caller's responsibility +# to call cur_test() to find out how many this executed BEGIN { require './test.pl'; @@ -51,9 +55,11 @@ foreach my $file (@w_files) { close F ; } -undef $/; +local $/ = undef; -plan tests => (scalar(@prgs)-$files + ($::local_tests || 0)); +my $tests = $::local_tests || 0; +$tests = scalar(@prgs)-$files + $tests if $tests !~ /\D/; +plan $tests; # If input is 'no_plan', pass it on unchanged for (@prgs){ unless (/\n/) -- Perl5 Master Repository
