From: Rafael Garcia-Suarez Date: Wed, 6 May 2009 20:10:43 +0000 (+0200) Subject: Rewrite tests for objects and ~~ X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=ad0781bc8e537599b237e04c8a07ff9a32d9a2ed;p=p5sagit%2Fp5-mst-13.2.git Rewrite tests for objects and ~~ --- diff --git a/t/op/smartmatch.t b/t/op/smartmatch.t index a1c1a06..3f0d305 100644 --- a/t/op/smartmatch.t +++ b/t/op/smartmatch.t @@ -114,7 +114,7 @@ sub NOT_DEF() { undef } # Values returned by a sub call __DATA__ # Any ~~ undef -!= $ov_obj undef +! $ov_obj undef ! $obj undef ! sub {} undef ! %hash undef @@ -139,27 +139,31 @@ __DATA__ &NOT_DEF undef # Any ~~ object overloaded -# object overloaded ~~ Any -=! $ov_obj \&fatal -= $ov_obj 'magic' -=! $ov_obj 'not magic' -=! $ov_obj $obj +! \&fatal $ov_obj + 'magic' $ov_obj +! 'not magic' $ov_obj +! $obj $ov_obj +! undef $ov_obj # regular object -@ $obj $obj -=@ $obj \&fatal -=@ $obj \&FALSE -=@ $obj \&foo -=@ $obj sub { 1 } -=@ $obj sub { 0 } -=@ $obj %keyandmore -=@ $obj {"key" => 1} -=@ $obj @fooormore -=@ $obj ["key" => 1] -=@ $obj /key/ -=@ $obj qr/key/ -=@ $obj "key" -=@ $obj FALSE +@ $obj $obj +@ $ov_obj $obj TODO +@ \&fatal $obj +@ \&FALSE $obj +@ \&foo $obj +@ sub { 1 } $obj +@ sub { 0 } $obj +@ %keyandmore $obj +@ {"key" => 1} $obj +@ @fooormore $obj +@ ["key" => 1] $obj +@ /key/ $obj +@ qr/key/ $obj +@ "key" $obj +@ FALSE $obj + +# object (overloaded or not) ~~ Any +# TODO # ~~ Coderef sub{0} sub { ref $_[0] eq "CODE" }