X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Fop%2Ftie.t;h=afcc4a16355ad3a223d0a899779a0972a9899021;hb=22d4bb9ccb8701e68f9243547d7e3a3c55f70908;hp=9543420a4222e014c284033fcedc5ebf15a42aa9;hpb=4b19af017623bfa3bb72bb164598a517f586e0d3;p=p5sagit%2Fp5-mst-13.2.git diff --git a/t/op/tie.t b/t/op/tie.t index 9543420..afcc4a1 100755 --- a/t/op/tie.t +++ b/t/op/tie.t @@ -6,13 +6,14 @@ # Currently it only tests the untie warning chdir 't' if -d 't'; -unshift @INC, "../lib"; +@INC = '../lib'; $ENV{PERL5LIB} = "../lib"; $|=1; # catch warnings into fatal errors $SIG{__WARN__} = sub { die "WARNING: @_" } ; +$SIG{__DIE__} = sub { die @_ }; undef $/; @prgs = split "\n########\n", ; @@ -25,7 +26,7 @@ for (@prgs){ $results = $@ ; $results =~ s/\n+$//; $expected =~ s/\n+$//; - if ( $status or $results and $results !~ /^WARNING: $expected/){ + if ( $status or $results and $results !~ /^(WARNING: )?$expected/){ print STDERR "STATUS: $status\n"; print STDERR "PROG: $prog\n"; print STDERR "EXPECTED:\n$expected\n"; @@ -44,6 +45,21 @@ untie %h; EXPECT ######## +# standard behaviour, without any extra references +use Tie::Hash ; +{package Tie::HashUntie; + use base 'Tie::StdHash'; + sub UNTIE + { + warn "Untied\n"; + } +} +tie %h, Tie::HashUntie; +untie %h; +EXPECT +Untied +######## + # standard behaviour, with 1 extra reference use Tie::Hash ; $a = tie %h, Tie::StdHash; @@ -158,6 +174,7 @@ sub Self::DESTROY { $b = $_[0] + 0; } } die unless $a == $b; EXPECT +Self-ties are not supported ######## # Interaction of tie and vec