Skip to content

Commit

Permalink
Fixup lib/feature.t
Browse files Browse the repository at this point in the history
Fix Perl#228

Preserve test behavior and expected output by disabling strict
where it matters.

These tests could probably be reworked by enforcing strict, but
this would lead to earlier failures and we would probably not
test what we need.
  • Loading branch information
atoomic committed Aug 19, 2020
1 parent eea74fa commit d7a0f2b
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
8 changes: 4 additions & 4 deletions t/lib/feature/say
Expand Up @@ -3,7 +3,7 @@ Check the lexical scoping of the say keyword.

__END__
# No say; should be a syntax error.
use warnings;
use warnings; no strict;
say "Hello", "world";
EXPECT
Unquoted string "say" may clash with future reserved word at - line 3.
Expand All @@ -27,7 +27,7 @@ EXPECT
Helloworld
########
# feature out of scope; should be a syntax error.
use warnings;
use warnings; no strict;
{ use feature 'say'; }
say "Hello", "world";
EXPECT
Expand All @@ -41,7 +41,7 @@ Execution of - aborted due to compilation errors.
use warnings;
use feature 'say';
say "Hello", "world";
no feature;
no feature; no strict;
say "Hello", "world";
EXPECT
Unquoted string "say" may clash with future reserved word at - line 6.
Expand All @@ -54,7 +54,7 @@ Execution of - aborted due to compilation errors.
use warnings;
use feature 'say';
say "Hello", "world";
no feature 'say';
no feature 'say'; no strict;
say "Hello", "world";
EXPECT
Unquoted string "say" may clash with future reserved word at - line 6.
Expand Down
20 changes: 10 additions & 10 deletions t/lib/feature/switch
Expand Up @@ -3,28 +3,28 @@ Check the lexical scoping of the switch keywords.

__END__
# No switch; given should be a bareword.
use warnings; no warnings 'experimental::smartmatch';
no strict; use warnings; no warnings 'experimental::smartmatch';
print STDOUT given;
EXPECT
Unquoted string "given" may clash with future reserved word at - line 3.
given
########
# No switch; when should be a bareword.
use warnings; no warnings 'experimental::smartmatch';
no strict; use warnings; no warnings 'experimental::smartmatch';
print STDOUT when;
EXPECT
Unquoted string "when" may clash with future reserved word at - line 3.
when
########
# No switch; default should be a bareword.
use warnings; no warnings 'experimental::smartmatch';
no strict; use warnings; no warnings 'experimental::smartmatch';
print STDOUT default;
EXPECT
Unquoted string "default" may clash with future reserved word at - line 3.
default
########
# No switch; break should be a bareword.
use warnings; no warnings 'experimental::smartmatch';
no strict; use warnings; no warnings 'experimental::smartmatch';
print STDOUT break;
EXPECT
Unquoted string "break" may clash with future reserved word at - line 3.
Expand Down Expand Up @@ -63,7 +63,7 @@ Can't "break" outside a given block at - line 3.
use warnings; no warnings 'experimental::smartmatch';
{ use feature 'switch';
given (1) {print "Okay here\n";}
}
} no strict;
print STDOUT given;
EXPECT
Unquoted string "given" may clash with future reserved word at - line 6.
Expand All @@ -74,7 +74,7 @@ given
use warnings; no warnings 'experimental::smartmatch';
{ use feature 'switch';
given (1) { when(1) {print "Okay here\n";} }
}
} no strict;
print STDOUT when;
EXPECT
Unquoted string "when" may clash with future reserved word at - line 6.
Expand All @@ -85,7 +85,7 @@ when
use warnings; no warnings 'experimental::smartmatch';
{ use feature 'switch';
given (1) { default {print "Okay here\n";} }
}
} no strict;
print STDOUT default;
EXPECT
Unquoted string "default" may clash with future reserved word at - line 6.
Expand All @@ -96,7 +96,7 @@ default
use warnings; no warnings 'experimental::smartmatch';
{ use feature 'switch';
given (1) { break }
}
} no strict;
print STDOUT break;
EXPECT
Unquoted string "break" may clash with future reserved word at - line 6.
Expand All @@ -106,7 +106,7 @@ break
use warnings; no warnings 'experimental::smartmatch';
use feature 'switch';
given (1) { when(1) {print "Okay here\n";} }
no feature 'switch';
no feature 'switch'; no strict;
print STDOUT when;
EXPECT
Unquoted string "when" may clash with future reserved word at - line 6.
Expand All @@ -117,7 +117,7 @@ when
use warnings; no warnings 'experimental::smartmatch';
use feature 'switch';
given (1) { when(1) {print "Okay here\n";} }
no feature;
no feature; no strict;
print STDOUT when;
EXPECT
Unquoted string "when" may clash with future reserved word at - line 6.
Expand Down

0 comments on commit d7a0f2b

Please sign in to comment.