summaryrefslogtreecommitdiff
path: root/t/run
diff options
context:
space:
mode:
authorZefram <zefram@fysh.org>2017-11-22 17:23:57 +0000
committerZefram <zefram@fysh.org>2017-11-22 17:23:57 +0000
commit5f3202fa3e77c4a20de590df045af4683aaedffa (patch)
tree5572a671df6c4586c7d77cf8f98787eb0f457f07 /t/run
parent5e1cca32ac612f0b59508a99fbff671a693f39b9 (diff)
downloadperl-5f3202fa3e77c4a20de590df045af4683aaedffa.tar.gz
eviscerate smartmatch
Regularise smartmatch's operand handling, by removing the implicit enreferencement and just supplying scalar context. Eviscerate its runtime behaviour, by removing all the matching rules other than rhs overloading. Overload smartmatching in the Regexp package to perform regexp matching. There are consequential customisations to autodie, in two areas. Firstly, autodie::exception objects are matchers, but autodie has been advising smartmatching with the exception on the lhs. This has to change to the rhs, in both documentation and tests. Secondly, it uses smartmatching as part of its hint mechanism. Most of the hint examples, in documentation and tests, have to change to subroutines, to be portable across Perl versions.
Diffstat (limited to 't/run')
-rw-r--r--t/run/switches.t7
1 files changed, 1 insertions, 6 deletions
diff --git a/t/run/switches.t b/t/run/switches.t
index c293c6488e..d831b8b8c9 100644
--- a/t/run/switches.t
+++ b/t/run/switches.t
@@ -12,7 +12,7 @@ BEGIN {
BEGIN { require "./test.pl"; require "./loc_tools.pl"; }
-plan(tests => 137);
+plan(tests => 136);
use Config;
@@ -648,11 +648,6 @@ is( $r, "Hello, world!\n", "-E say" );
$r = runperl(
- switches => [ '-E', '"no warnings q{experimental::smartmatch}; undef ~~ undef and say q(Hello, world!)"']
-);
-is( $r, "Hello, world!\n", "-E ~~" );
-
-$r = runperl(
switches => [ '-E', '"no warnings q{experimental::smartmatch}; given(undef) {when(!defined) { say q(Hello, world!)"}}']
);
is( $r, "Hello, world!\n", "-E given" );