From 7e1dab6a61131a77ad847a43dacb66e48b0ab716 Mon Sep 17 00:00:00 2001 From: Nicholas Clark Date: Sat, 3 Dec 2011 11:59:05 +0000 Subject: [PATCH] Tidy up t/re/regexp.t Eliminate the declaration of $numtests, unused since commit 1a6108908b085da4. Convert $iters and $OP to lexicals. Remove the vestigial logic for finding t/re/re_tests - the MacOS classic style pathname is redundant now, and the file can never be found at t/re/re_tests given that there is a chdir 't' in the BEGIN block. --- t/re/regexp.t | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/t/re/regexp.t b/t/re/regexp.t index 3e5c6f8..c54c5a3 100644 --- a/t/re/regexp.t +++ b/t/re/regexp.t @@ -44,7 +44,7 @@ # Note that columns 2,3 and 5 are all enclosed in double quotes and then # evalled; so something like a\"\x{100}$1 has length 3+length($1). -my $file; +my ($file, $iters); BEGIN { $iters = shift || 1; # Poor man performance suite, 10000 is OK. @@ -66,13 +66,12 @@ sub _comment { use strict; use warnings FATAL=>"all"; -use vars qw($iters $numtests $bang $ffff $nulnul $OP); +use vars qw($bang $ffff $nulnul); # used by the tests use vars qw($qr $skip_amp $qr_embed $qr_embed_thr); # set by our callers if (!defined $file) { - open(TESTS,'re/re_tests') || open(TESTS,'t/re/re_tests') - || open(TESTS,':re:re_tests') || die "Can't open re_tests"; + open TESTS, 're/re_tests' or die "Can't open re/re_tests: $!"; } my @tests = ; @@ -82,7 +81,7 @@ close TESTS; $bang = sprintf "\\%03o", ord "!"; # \41 would not be portable. $ffff = chr(0xff) x 2; $nulnul = "\0" x 2; -$OP = $qr ? 'qr' : 'm'; +my $OP = $qr ? 'qr' : 'm'; $| = 1; printf "1..%d\n# $iters iterations\n", scalar @tests; -- 2.7.4