File: v6-split-bulk.t

package info (click to toggle)
libnetaddr-ip-perl 4.079%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 1,568 kB
  • sloc: perl: 1,417; cpp: 67; makefile: 9
file content (21 lines) | stat: -rw-r--r-- 513 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
use Test::More;
use NetAddr::IP;

# $Id: v6-split-bulk.t,v 1.1.1.1 2006/08/14 15:36:06 lem Exp $

my @addr = (
	     [ 'dead:beef::1', 126, 127, 2 ],
	     [ 'dead:beef::1', 127, 127, 1 ],
	     [ 'dead:beef::1', 127, 128, 2 ],
	     [ 'dead:beef::1', 128, 128, 1 ],
	     [ 'dead:beef::1', 124, 128, 16 ],
	     [ 'dead:beef::1', 124, 127, 8 ],
	    );

plan tests => (scalar @addr);

for my $a (@addr) {
    my $ip = new NetAddr::IP $a->[0], $a->[1];
    my $r = $ip->splitref($a->[2]);
    is(@$r, $a->[3]);
}