-
Notifications
You must be signed in to change notification settings - Fork 561
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
implement the smartmatch feature and test it
interestingly the TOKEN(0) line here isn't exercised by the test suite, I haven't tracked down what it would take to exercise it. The deprecation messages will be removed in an upcoming commit
- Loading branch information
Showing
3 changed files
with
52 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
Test no feature smartmatch | ||
|
||
__END__ | ||
# NAME default | ||
my @x = qw(a b c); | ||
my $y = "b" ~~ @x; | ||
EXPECT | ||
Smartmatch is deprecated at - line 2. | ||
######## | ||
# NAME explicit disable | ||
no feature "smartmatch"; | ||
my @x = qw(a b c); | ||
my $y = "b" ~~ @x; | ||
EXPECT | ||
OPTION fatal | ||
syntax error at - line 3, near ""b" ~" | ||
Execution of - aborted due to compilation errors. | ||
######## | ||
# NAME explicit enable | ||
use feature "smartmatch"; | ||
my @x = qw(a b c); | ||
my $y = "b" ~~ @x; | ||
EXPECT | ||
Smartmatch is deprecated at - line 3. | ||
######## | ||
# NAME explicit disable then enable | ||
no feature "smartmatch"; | ||
use feature "smartmatch"; | ||
my @x = qw(a b c); | ||
my $y = "b" ~~ @x; | ||
EXPECT | ||
Smartmatch is deprecated at - line 4. | ||
######## | ||
# NAME implicit disable | ||
use v5.41; | ||
my @x = qw(a b c); | ||
my $y = "b" ~~ @x; | ||
EXPECT | ||
OPTION fatal | ||
syntax error at - line 3, near ""b" ~" | ||
Execution of - aborted due to compilation errors. | ||
######## | ||
# NAME implicit disable then enable | ||
use v5.41; | ||
use feature "smartmatch"; | ||
my @x = qw(a b c); | ||
my $y = "b" ~~ @x; | ||
EXPECT | ||
Smartmatch is deprecated at - line 4. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters