Skip to content

Commit c42c667

Browse files
committed
deprecation.t: Comment out tests
We're superseding a warning about the impending fatalization of goto-label-jump with an exception. Hence the deprecation warning no longer needs to be tested in t/porting/deprecation.t. However, we may (or may not) have been using that particular warning as corpur for *other* tests of deprecation warnings. For the time being, we'll comment out 3 test blocks and mark them as TODO.
1 parent 6db4e2d commit c42c667

File tree

1 file changed

+57
-52
lines changed

1 file changed

+57
-52
lines changed

t/porting/deprecation.t

Lines changed: 57 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -90,56 +90,61 @@ if (-e ".git") {
9090
"There should not be any new files which mention WARN_DEPRECATED");
9191
}
9292

93-
# Test that deprecation warnings are produced under "use warnings"
94-
# (set above)
95-
{
96-
my $warning = "nada";
97-
local $SIG{__WARN__} = sub { $warning = $_[0] };
98-
my $count = 0;
99-
while ($count<1) {
100-
LABEL: $count++;
101-
goto DONE if $count>1;
102-
}
103-
goto LABEL;
104-
DONE:
105-
like($warning,
106-
qr/Use of "goto" to jump into a construct is deprecated, and will become fatal in Perl 5\.42/,
107-
"Got expected deprecation warning");
108-
}
109-
# Test that we can silence deprecation warnings with "no warnings 'deprecated'"
110-
# as we used to.
111-
{
112-
no warnings 'deprecated';
113-
my $warning = "nada";
114-
local $SIG{__WARN__} = sub { $warning = $_[0] };
115-
my $count = 0;
116-
while ($count<1) {
117-
LABEL: $count++;
118-
goto DONE if $count>1;
119-
}
120-
goto LABEL;
121-
DONE:
122-
like($warning, qr/nada/,
123-
"no warnings 'deprecated'; silenced deprecation warning as expected");
124-
}
93+
# TODO: We don't need the 3 following test blocks for "Use of goto to jump
94+
# into a construct is deprecated" anymore ... but we may have been using these
95+
# blocks to test deprecation warnings more generally. Hence, comment them out
96+
# for now (so that 'make test_porting' passes) and investigate further later.
97+
#
98+
## Test that deprecation warnings are produced under "use warnings"
99+
## (set above)
100+
#{
101+
# my $warning = "nada";
102+
# local $SIG{__WARN__} = sub { $warning = $_[0] };
103+
# my $count = 0;
104+
# while ($count<1) {
105+
# LABEL: $count++;
106+
# goto DONE if $count>1;
107+
# }
108+
# goto LABEL;
109+
# DONE:
110+
# like($warning,
111+
# qr/Use of "goto" to jump into a construct is deprecated, and will become fatal in Perl 5\.42/,
112+
# "Got expected deprecation warning");
113+
#}
114+
## Test that we can silence deprecation warnings with "no warnings 'deprecated'"
115+
## as we used to.
116+
#{
117+
# no warnings 'deprecated';
118+
# my $warning = "nada";
119+
# local $SIG{__WARN__} = sub { $warning = $_[0] };
120+
# my $count = 0;
121+
# while ($count<1) {
122+
# LABEL: $count++;
123+
# goto DONE if $count>1;
124+
# }
125+
# goto LABEL;
126+
# DONE:
127+
# like($warning, qr/nada/,
128+
# "no warnings 'deprecated'; silenced deprecation warning as expected");
129+
#}
125130

126-
# Test that we can silence a specific deprecation warnings with "no warnings 'deprecated::$subcategory'"
127-
# and that by doing so we don't silence any other deprecation warnings.
128-
{
129-
no warnings 'deprecated::goto_construct';
130-
my $warning = "nada";
131-
local $SIG{__WARN__} = sub { $warning = $_[0] };
132-
my $count = 0;
133-
while ($count<1) {
134-
LABEL: $count++;
135-
goto DONE if $count>1;
136-
}
137-
goto LABEL;
138-
DONE:
139-
like($warning, qr/nada/,
140-
"no warnings 'deprecated::goto_construct'; silenced deprecation warning as expected");
141-
@INC = ();
142-
do "regen.pl"; # this should produce a deprecation warning
143-
like($warning, qr/is no longer in \@INC/,
144-
"no warnings 'deprecated::goto_construct'; did not silence deprecated::dot_in_inc warnings");
145-
}
131+
## Test that we can silence a specific deprecation warnings with "no warnings 'deprecated::$subcategory'"
132+
## and that by doing so we don't silence any other deprecation warnings.
133+
#{
134+
# no warnings 'deprecated::goto_construct';
135+
# my $warning = "nada";
136+
# local $SIG{__WARN__} = sub { $warning = $_[0] };
137+
# my $count = 0;
138+
# while ($count<1) {
139+
# LABEL: $count++;
140+
# goto DONE if $count>1;
141+
# }
142+
# goto LABEL;
143+
# DONE:
144+
# like($warning, qr/nada/,
145+
# "no warnings 'deprecated::goto_construct'; silenced deprecation warning as expected");
146+
# @INC = ();
147+
# do "regen.pl"; # this should produce a deprecation warning
148+
# like($warning, qr/is no longer in \@INC/,
149+
# "no warnings 'deprecated::goto_construct'; did not silence deprecated::dot_in_inc warnings");
150+
#}

0 commit comments

Comments
 (0)