Skip to content

Commit f85e1f0

Browse files
authored
Merge pull request #3 from briandfoy/p7
Silence some test warnings
2 parents f6f267a + 2ce1d7b commit f85e1f0

File tree

5 files changed

+35
-18
lines changed

5 files changed

+35
-18
lines changed

t/TEST

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -117,10 +117,13 @@ my %skip = (
117117
'.svn' => 1,
118118
);
119119

120-
120+
{
121+
no warnings qw(once);
122+
# this variable is set in t/harness
121123
if ($::do_nothing) {
122124
return 1;
123125
}
126+
}
124127

125128
$| = 1;
126129

@@ -188,7 +191,7 @@ sub _find_files {
188191
next if $skip{$f};
189192

190193
my $fullpath = "$dir/$f";
191-
194+
192195
if (-d $fullpath) {
193196
_find_files($patt, $fullpath);
194197
} elsif ($f =~ /$patt/) {
@@ -482,7 +485,7 @@ unless (@ARGV) {
482485
}
483486
unless ($::core) {
484487
_find_tests('porting');
485-
_find_tests("lib");
488+
_find_tests("lib");
486489
}
487490
# Config.pm may be broken for make minitest. And this is only a refinement
488491
# for skipping tests on non-default builds, so it is allowed to fail.

t/opbasic/concat.t

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,15 @@ my ($a, $b, $c) = qw(foo bar);
4343

4444
ok("$a" eq "foo", "verifying assign");
4545
ok("$a$b" eq "foobar", "basic concatenation");
46+
{
47+
no warnings qw(uninitialized);
4648
ok("$c$a$c" eq "foo", "concatenate undef, fore and aft");
49+
}
4750

4851
# Okay, so that wasn't very challenging. Let's go Unicode.
4952

5053
{
51-
# bug id 20000819.004 (#3761)
54+
# bug id 20000819.004 (#3761)
5255
my $dx;
5356
$_ = $dx = "\x{10f2}";
5457
s/($dx)/$dx$1/;
@@ -77,12 +80,16 @@ ok("$c$a$c" eq "foo", "concatenate undef, fore and aft");
7780
my $a;
7881
$a .= "\x{1ff}";
7982
ok($a eq "\x{1ff}", "bug id 20000901.092 (#4184), undef left");
80-
$a .= undef;
81-
ok($a eq "\x{1ff}", "bug id 20000901.092 (#4184), undef right");
83+
{
84+
no warnings qw(uninitialized);
85+
$a .= undef;
86+
ok($a eq "\x{1ff}", "bug id 20000901.092 (#4184), undef right");
87+
}
8288
}
8389

8490
{
8591
# ID 20001020.006 (#4484)
92+
no warnings qw(void uninitialized);
8693

8794
"x" =~ /(.)/; # unset $2
8895

@@ -96,6 +103,7 @@ ok("$c$a$c" eq "foo", "concatenate undef, fore and aft");
96103
ok(!$@, "bug id 20001020.006 (#4484), right");
97104

98105
my $pi;
106+
no warnings qw(once);
99107
*pi = \undef;
100108
# This bug existed earlier than the $2 bug, but is fixed with the same
101109
# patch. Without the fix this 5.7.0 would also croak:
@@ -126,6 +134,7 @@ sub beq { use bytes; $_[0] eq $_[1]; }
126134
}
127135

128136
{
137+
no warnings qw(void);
129138
my $a; ($a .= 5) . 6;
130139
ok($a == 5, '($a .= 5) . 6 - present since 5.000');
131140
}
@@ -761,8 +770,9 @@ ok(ref(CORE::state $y = "a $o b") eq 'o',
761770
$s->($h{foo});
762771
is($h{foo}, "ab", "PVLV");
763772

764-
# assigning a string to a typeglob creates an alias
773+
# assigning a string to a typeglob creates an alias
765774
no strict;
775+
no warnings qw(void once);
766776
$Foo = 'myfoo';
767777
*Bar = ("F" . $o . $o);
768778
is($Bar, "myfoo", '*Bar = "Foo"');
@@ -782,6 +792,7 @@ ok(ref(CORE::state $y = "a $o b") eq 'o',
782792

783793
{
784794
my $foo = "foo";
795+
no warnings qw(void uninitialized);
785796
my $a . $foo; # weird but legal
786797
is($a, '', 'my $a . $foo');
787798
my $b; $b .= $foo;

t/re/reg_eval_scope.t

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ CODE
101101
"ba" =~ /b${\do { package baz; qr|(?{ $::pack = __PACKAGE__ })a| }}/;
102102
is $pack, 'baz', '/text$qr/ inherits package';
103103
"ba" =~ m+b${\do { use re "/i"; qr|(?{ $::re = qr-- })a| }}+;
104-
is $re, '(?^i:)', '/text$qr/ inherits pragmata';
104+
is $re, '(?^i:)', '/text$qr/ inherits pragmata';
105105

106106
{
107107
use re 'eval';
@@ -226,7 +226,7 @@ CODE
226226

227227

228228
{
229-
local $::TODO = "goto doesn't yet work in pseduo blocks";
229+
local $::TODO = "goto doesn't yet work in pseudo blocks";
230230
fresh_perl_is <<'CODE',
231231
my $a=4; my $b=5;
232232
"a" =~ /(?{ goto FOO; print "X"; FOO: print "Y"; })a/;
@@ -355,13 +355,13 @@ SKIP: {
355355
# [perl #113928] caller behaving unexpectedly in re-evals
356356
#
357357
# make sure __SUB__ within a code block returns something safe.
358-
# NB waht it actually returns is subject to change
358+
# NB what it actually returns is subject to change
359359

360360
{
361361

362362
my $s;
363363

364-
sub f1 { /(?{ $s = CORE::__SUB__; })/ }
364+
sub f1 { '' =~ /(?{ $s = CORE::__SUB__; })/ }
365365
f1();
366366
is ($s, \&f1, '__SUB__ direct');
367367

t/re/regexp_qr_embed_thr.t

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,10 @@ skip_all_without_config('useithreads');
77
skip_all_if_miniperl("no dynamic loading on miniperl, no threads");
88
require threads;
99

10+
{
11+
no warnings qw(once);
1012
$::qr = 1;
1113
$::qr_embed_thr = 1;
14+
}
1215

1316
require './re/regexp.t';

t/re/subst.t

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -298,12 +298,12 @@ my %MK = (
298298
E => '$(F)', F=>'p $(G) q', G => 'HHHHH', # short->long
299299
DIR => '$(UNDEFINEDNAME)/xxx',
300300
);
301-
sub var {
301+
sub var {
302302
my($var,$level) = @_;
303303
return "\$($var)" unless exists $MK{$var};
304304
return exp_vars($MK{$var}, $level+1); # can recurse
305305
}
306-
sub exp_vars {
306+
sub exp_vars {
307307
my($str,$level) = @_;
308308
$str =~ s/\$\((\w+)\)/var($1, $level+1)/ge; # can recurse
309309
#warn "exp_vars $level = '$str'\n";
@@ -389,8 +389,8 @@ $_ = 'a' x 6;
389389
$snum = s/a(?{})//g;
390390
ok( $_ eq '' && $snum == 6 );
391391

392-
$_ = 'x' x 20;
393-
$snum = s/(\d*|x)/<$1>/g;
392+
$_ = 'x' x 20;
393+
$snum = s/(\d*|x)/<$1>/g;
394394
$foo = '<>' . ('<x><>' x 20) ;
395395
ok( $_ eq $foo && $snum == 41 );
396396

@@ -466,7 +466,7 @@ substr($pv2,0,1) = "\x{100}";
466466
is($pv1, $pv2);
467467

468468
{
469-
{
469+
{
470470
# Gregor Chrupala <[email protected]>
471471
use utf8;
472472
$a = 'Espa&ntilde;a';
@@ -585,7 +585,7 @@ is("<$_> <$s>", "<> <4>", "[perl #7806]");
585585

586586
# [perl #19048] Coredump in silly replacement
587587
{
588-
local $^W = 0;
588+
no warnings qw(uninitialized);
589589
$_="abcdef\n";
590590
s!.!!eg;
591591
is($_, "\n", "[perl #19048]");
@@ -829,7 +829,7 @@ fresh_perl_is( '$_="abcdefg123456"; s/(?<=...\G)?(\d)/($1)/; print' => 'abcdefg(
829829
$output, "CCCGGG< >< >< >< >< >< >",
830830
's/// sets PL_curpm for each iteration even when the RHS has set it'
831831
);
832-
832+
833833
s/C/$a{m\G\}/;
834834
is(
835835
"$&", G =>

0 commit comments

Comments
 (0)