X-Git-Url: https://perl5.git.perl.org/perl5.git/blobdiff_plain/ce16035962bc2117880a4ecb26e4fbfb2846bd7e..4ba80ef4d6196579c7914cb88df2e8ca3595224a:/t/op/try.t diff --git a/t/op/try.t b/t/op/try.t index bc9df83..90702fe 100644 --- a/t/op/try.t +++ b/t/op/try.t @@ -98,60 +98,60 @@ no warnings 'experimental::try'; # Loop controls inside try {} do not emit warnings { - my $warnings = ""; - local $SIG{__WARN__} = sub { $warnings .= $_[0] }; - - { - try { - last; - } - catch ($e) { } - } - - { - try { - next; - } - catch ($e) { } - } - - my $count = 0; - { - try { - $count++; - redo if $count < 2; - } - catch ($e) { } - } - - is($warnings, "", 'No warnings emitted by next/last/redo inside try'); - - $warnings = ""; - - LOOP_L: { - try { - last LOOP_L; - } - catch ($e) { } - } - - LOOP_N: { - try { - next LOOP_N; - } - catch ($e) { } - } - - $count = 0; - LOOP_R: { - try { - $count++; - redo LOOP_R if $count < 2; - } - catch ($e) { } - } - - is($warnings, "", 'No warnings emitted by next/last/redo LABEL inside try'); + my $warnings = ""; + local $SIG{__WARN__} = sub { $warnings .= $_[0] }; + + { + try { + last; + } + catch ($e) { } + } + + { + try { + next; + } + catch ($e) { } + } + + my $count = 0; + { + try { + $count++; + redo if $count < 2; + } + catch ($e) { } + } + + is($warnings, "", 'No warnings emitted by next/last/redo inside try'); + + $warnings = ""; + + LOOP_L: { + try { + last LOOP_L; + } + catch ($e) { } + } + + LOOP_N: { + try { + next LOOP_N; + } + catch ($e) { } + } + + $count = 0; + LOOP_R: { + try { + $count++; + redo LOOP_R if $count < 2; + } + catch ($e) { } + } + + is($warnings, "", 'No warnings emitted by next/last/redo LABEL inside try'); } # try/catch should localise $@