diff options
author | Zefram <zefram@fysh.org> | 2017-11-22 17:23:57 +0000 |
---|---|---|
committer | Zefram <zefram@fysh.org> | 2017-11-22 17:23:57 +0000 |
commit | 5f3202fa3e77c4a20de590df045af4683aaedffa (patch) | |
tree | 5572a671df6c4586c7d77cf8f98787eb0f457f07 /t/run | |
parent | 5e1cca32ac612f0b59508a99fbff671a693f39b9 (diff) | |
download | perl-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.t | 7 |
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" ); |