tie.t revision 7c478bd95313f5f23a4c958a745db2134aa03244
#!./perl
# This test harness will (eventually) test the "tie" functionality
# without the need for a *DBM* implementation.
# Currently it only tests the untie warning
chdir 't' if -d 't';
@INC = '../lib';
$|=1;
# catch warnings into fatal errors
undef $/;
$status = $?;
$results = $@ ;
$results =~ s/\n+$//;
$expected =~ s/\n+$//;
print "not ";
}
print "ok ", ++$i, "\n";
}
# standard behaviour, without any extra references
untie %h;
########
# standard behaviour, without any extra references
sub UNTIE
{
}
}
untie %h;
########
# standard behaviour, with 1 extra reference
untie %h;
########
# standard behaviour, with 1 extra reference via tied
$a = tied %h;
untie %h;
########
# standard behaviour, with 1 extra reference which is destroyed
$a = 0 ;
untie %h;
########
# standard behaviour, with 1 extra reference via tied which is destroyed
$a = tied %h;
$a = 0 ;
untie %h;
########
# strict behaviour, without any extra references
use warnings 'untie';
untie %h;
########
# strict behaviour, with 1 extra references generating an error
use warnings 'untie';
untie %h;
########
# strict behaviour, with 1 extra references via tied generating an error
use warnings 'untie';
$a = tied %h;
untie %h;
########
# strict behaviour, with 1 extra references which are destroyed
use warnings 'untie';
$a = 0 ;
untie %h;
########
# strict behaviour, with extra 1 references via tied which are destroyed
use warnings 'untie';
$a = tied %h;
$a = 0 ;
untie %h;
########
# strict error behaviour, with 2 extra references
use warnings 'untie';
$b = tied %h ;
untie %h;
########
# strict behaviour, check scope of strictness.
$C = $B = tied %H ;
{
untie %h;
}
untie %H;
########
# verify no leak when underlying object is selfsame tied variable
my ($a, $b);
{
my %b5;
$a = \%b5 + 0;
}
########
# Interaction of tie and vec
my ($a, $b);
$a = $b;