Codebase list libnet-ip-xs-perl / debian/0.17-1 t / 12-iplengths.t
debian/0.17-1

Tree @debian/0.17-1 (Download .tar.gz)

12-iplengths.t @debian/0.17-1raw · history · blame

#!perl

use warnings;
use strict;

use Test::More tests => 4;

use Net::IP::XS qw(ip_iplengths);
use IO::Capture::Stderr;

my $len = ip_iplengths(4);
is($len, 32, 'ip_iplengths 4');

$len = ip_iplengths(6);
is($len, 128, 'ip_iplengths 6');

$len = ip_iplengths(8);
is($len, undef, 'ip_iplengths invalid');

my $c = IO::Capture::Stderr->new();
$c->start();
$len = ip_iplengths(undef);
is($len, undef, 'ip_iplengths invalid');

1;