diff options
author | Rafael Garcia-Suarez <rgarciasuarez@gmail.com> | 2009-05-09 15:37:11 +0200 |
---|---|---|
committer | Rafael Garcia-Suarez <rgarciasuarez@gmail.com> | 2009-05-09 15:37:11 +0200 |
commit | 0483c67272447ab9cf7bf63ea915eccf128eda1a (patch) | |
tree | ed0c26520b9fb0cd9a13740897b1a6d9199843d8 /t/op/smartmatch.t | |
parent | 41e726ac827d803b499877b6a79913968b88cf46 (diff) | |
download | perl-0483c67272447ab9cf7bf63ea915eccf128eda1a.tar.gz |
Add tests for object ~~ regexp
Diffstat (limited to 't/op/smartmatch.t')
-rw-r--r-- | 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 0b5c9a1d9e..fa66de99b7 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" } |