In perl.git, the branch smartmatch has been updated <http://perl5.git.perl.org/perl.git/commitdiff/0483c67272447ab9cf7bf63ea915eccf128eda1a?hp=41e726ac827d803b499877b6a79913968b88cf46>
- Log ----------------------------------------------------------------- commit 0483c67272447ab9cf7bf63ea915eccf128eda1a Author: Rafael Garcia-Suarez <[email protected]> Date: Sat May 9 15:37:11 2009 +0200 Add tests for object ~~ regexp ----------------------------------------------------------------------- Summary of changes: t/op/smartmatch.t | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) diff --git a/t/op/smartmatch.t b/t/op/smartmatch.t index 0b5c9a1..fa66de9 100644 --- a/t/op/smartmatch.t +++ b/t/op/smartmatch.t @@ -35,6 +35,7 @@ tie my %tied_hash, 'Tie::StdHash'; package Test::Object::CopyOverload; sub new { bless { key => 'magic' } } use overload '~~' => sub { my %hash = %{ $_[0] }; $_[1] eq $hash{key} }; + use overload '""' => sub { "stringified" }; } our $ov_obj = Test::Object::CopyOverload->new; @@ -167,7 +168,8 @@ __DATA__ @ FALSE $obj # object (overloaded or not) ~~ Any -# TODO + $obj qr/NoOverload/ + $ov_obj qr/^stringified$/ # ~~ Coderef sub{0} sub { ref $_[0] eq "CODE" } -- Perl5 Master Repository
