HEX
Server: Apache
System: Linux server-674799.igrow.ws 5.14.0-611.30.1.el9_7.x86_64 #1 SMP PREEMPT_DYNAMIC Wed Feb 11 06:42:00 EST 2026 x86_64
User: elrashedytravel (1025)
PHP: 8.1.34
Disabled: exec,passthru,shell_exec,system
Upload Files
File: /home/.cpan/build/NetAddr-IP-4.079-0/t/old-store.t
# t/old-store.t - test backwards compatible Storable interaction

use Test::More;

my $tests = 7;

plan tests => $tests;

SKIP:
{
    skip "Failed to use Storable, module not found", $tests
	unless eval { require Storable && use_ok("Storable", 'freeze', 'thaw')};

    skip "Failed to use NetAddr::IP", $tests
	unless use_ok("NetAddr::IP", ':old_storable');

    my $oip = new NetAddr::IP "localhost";
    my $nip;

    isa_ok($oip, 'NetAddr::IP', 'Correct return type');

    my $serialized;

    eval { $serialized = freeze($oip) };
    unless (ok(!$@, "Freezing"))
    {
	diag $@;
    }

#    diag "Result is '$serialized'";

    eval { $nip = thaw($serialized) };
    unless (ok(!$@, "Thawing"))
    {
	diag $@;
    }

    isa_ok($nip, 'NetAddr::IP', 'Recovered correct type');
    is("$nip", "$oip", "New object eq original object");
}