From: Rafael Garcia-Suarez Date: Tue, 17 Feb 2009 12:56:43 +0000 (+0100) Subject: Reorder and complete tests for smart matching with objects X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=4cbab0e90c8cb27eaf6e77be6ce33165799f92df;p=p5sagit%2Fp5-mst-13.2.git Reorder and complete tests for smart matching with objects --- diff --git a/t/op/smartmatch.t b/t/op/smartmatch.t index e2ea004..48b882d 100644 --- a/t/op/smartmatch.t +++ b/t/op/smartmatch.t @@ -95,20 +95,25 @@ __DATA__ # OBJECT # - overloaded $ov_obj "key" - $ov_obj {"key" => 1} ! $ov_obj "foo" + $ov_obj {"key" => 1} +! $ov_obj {"foo" => 1} + $ov_obj ["key" => 1] +! $ov_obj ["foo" => 1] $ov_obj sub { shift ~~ "key" } ! $ov_obj sub { shift ~~ "foo" } ! $ov_obj \&foo + $ov_obj \&bar @ $ov_obj \&fatal ! $ov_obj FALSE ! $ov_obj \&FALSE ! $ov_obj undef + $ov_obj $ov_obj # regular object @ $obj "key" @ $obj {"key" => 1} -@ $obj $obj +@ $obj ["key" => 1] @ $obj sub { 1 } @ $obj sub { 0 } @ $obj \&foo @@ -116,6 +121,7 @@ __DATA__ @ $obj FALSE @ $obj \&FALSE ! $obj undef +@ $obj $obj # CODE ref against argument # - arg is code ref @@ -146,8 +152,6 @@ __DATA__ @ [] \&fatal @ "foo" \&fatal @ qr// \&fatal -@ $obj \&bar - $ov_obj \&bar # - null-prototyped subs a_const "a constant"