HEX
Server: Apache
System: Linux server-634962.emtiyz.com 5.14.0-611.11.1.el9_7.x86_64 #1 SMP PREEMPT_DYNAMIC Wed Dec 3 09:47:37 EST 2025 x86_64
User: codo66ho (1003)
PHP: 8.2.29
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");
}