The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.
use lib 't';
# vim: ts=8 et sw=4 sts=4
use strict;
use warnings;
use ExtUtils::testlib;
use Storable::AMF0 qw(freeze thaw retrieve ref_lost_memory);
use GrianUtils;
my $directory = qw(t/AMF0);
my @item ;
@item = GrianUtils->my_items($directory);

my $total = @item*1;
eval "use Test::More tests=>$total;";
warn $@ if $@;

TEST_LOOP: 
for my $item (@item) {
    my ( $name, $obj, $image_amf0 ) = @$item{qw(name obj amf0)};
    my $new_obj;
    if ( ref_lost_memory($obj) ) {
        ok( !defined( thaw( $image_amf0, 1 ) ), "thaw(strict) recurrent $name" );
    }
    else {
        if ( defined($obj) ) {
            ok( defined( thaw( $image_amf0, 1 ) ), "thaw(strict) non-recurrent $name" );
        }
        else {
            ok(1);
        }
    }
}