diff options
author | Rafael Garcia-Suarez <rgarciasuarez@gmail.com> | 2007-01-15 18:25:45 +0000 |
---|---|---|
committer | Rafael Garcia-Suarez <rgarciasuarez@gmail.com> | 2007-01-15 18:25:45 +0000 |
commit | 3e7dd34d07ec3fbcf1e108a3270d6009e068e8eb (patch) | |
tree | 221d72357a1188182ff576ec9f1933e27f280439 /t | |
parent | 607905347eb1bbe08eb76ed3e8e9e27622ad97ed (diff) | |
download | perl-3e7dd34d07ec3fbcf1e108a3270d6009e068e8eb.tar.gz |
Enable the ~~ operator by default.
Remove the ~~ feature.
p4raw-id: //depot/perl@29838
Diffstat (limited to 't')
-rw-r--r-- | t/lib/feature/smartmatch | 45 | ||||
-rw-r--r-- | t/op/smartmatch.t | 5 |
2 files changed, 1 insertions, 49 deletions
diff --git a/t/lib/feature/smartmatch b/t/lib/feature/smartmatch deleted file mode 100644 index 16ea7f8a92..0000000000 --- a/t/lib/feature/smartmatch +++ /dev/null @@ -1,45 +0,0 @@ -Check the lexical scoping of the switch keywords. -(The actual behaviour is tested in t/op/smartmatch.t) - -__END__ -# No ~~; should be a syntax error. -use warnings; -print +(2 ~~ 2); -EXPECT -syntax error at - line 3, near "2 ~" -Execution of - aborted due to compilation errors. -######## -# With ~~, should work -use warnings; -use feature "~~"; -print +(2 ~~ 2); -EXPECT -1 -######## -# ~~ out of scope; should be a syntax error. -use warnings; -{ use feature '~~'; } -print +(2 ~~ 2); -EXPECT -syntax error at - line 4, near "2 ~" -Execution of - aborted due to compilation errors. -######## -# 'no feature' should work -use warnings; -use feature '~~'; -print +(2 ~~ 2), "\n"; -no feature; -print +(2 ~~ 2), "\n"; -EXPECT -syntax error at - line 6, near "2 ~" -Execution of - aborted due to compilation errors. -######## -# 'no feature "~~"' should work too -use warnings; -use feature '~~'; -print +(2 ~~ 2), "\n"; -no feature "~~"; -print +(2 ~~ 2), "\n"; -EXPECT -syntax error at - line 6, near "2 ~" -Execution of - aborted due to compilation errors. diff --git a/t/op/smartmatch.t b/t/op/smartmatch.t index 6275f40b0f..3c6d1c3c95 100644 --- a/t/op/smartmatch.t +++ b/t/op/smartmatch.t @@ -48,10 +48,7 @@ sub match_test { my $tstr = "$left ~~ $right"; my $res; - { - use feature "~~"; - $res = eval $tstr // ""; #/ <- fix syntax colouring - } + $res = eval $tstr // ""; #/ <- fix syntax colouring die $@ if $@ ne ""; ok( ($yn =~ /!/ xor $res), "$tstr: $res"); |