X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2F23_is_X_value.t;h=79c003ee429248a4ede0557666d07d0364b5677e;hb=d0ecdb28a6c6ba2112bf49e3fa687ee989353a9f;hp=b919e0a72cecd131b66fd703def845995a410361;hpb=a1c9e0ff9f5080ab1f556b133d94af28c9a6b542;p=scpubgit%2FQ-Branch.git diff --git a/t/23_is_X_value.t b/t/23_is_X_value.t index b919e0a..79c003e 100644 --- a/t/23_is_X_value.t +++ b/t/23_is_X_value.t @@ -3,6 +3,8 @@ use strict; use Test::More; use Test::Exception; +use Scalar::Util 'refaddr'; +use Storable 'nfreeze'; use SQL::Abstract qw(is_plain_value is_literal_value); @@ -54,15 +56,26 @@ lives_ok { ok( ( $nummifiable_maybefallback_num + 1) == 43 ) }; - my $can_str = !! eval { "$nummifiable_maybefallback_num" }; + my $is_pv_res = is_plain_value $nummifiable_maybefallback_num; - lives_ok { - is_deeply( - is_plain_value $nummifiable_maybefallback_num, - ( $can_str ? [ 42 ] : undef ), - 'parent-disabled-fallback stringification detected same as perl', + # this perl can recognize inherited fallback + if ( !! eval { "$nummifiable_maybefallback_num" } ) { + # we may *not* be able to compare, due to ""-derived-eq fallbacks missing, + # but we can always compare the ice + ok ( + ( nfreeze( $is_pv_res ) eq nfreeze( [ $nummifiable_maybefallback_num ] ) ), + 'parent-disabled-fallback stringification matches that of perl' ); - }; + + is ( + refaddr($is_pv_res->[0]), + refaddr $nummifiable_maybefallback_num, + "Same reference (blessed object) returned", + ); + } + else { + is $is_pv_res, undef, 'parent-disabled-fallback stringification matches that of perl'; + } } is_deeply