From: Rafael Garcia-Suarez Date: Sat, 9 May 2009 13:37:11 +0000 (+0200) Subject: Add tests for object ~~ regexp X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=0483c67272447ab9cf7bf63ea915eccf128eda1a;p=p5sagit%2Fp5-mst-13.2.git Add tests for object ~~ regexp --- 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" }