File: over-qq.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 (55 lines) | stat: -rw-r--r-- 800 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
use NetAddr::IP;

# $Id: over-qq.t,v 1.1.1.1 2006/08/14 15:36:06 lem Exp $

my @addr = ('10.0.0.0/8', '192.168.0.0/16', '127.0.0.1/32');

$| = 1;

print "1..", 5 * scalar @addr, "\n";

my $count = 1;

for my $a (@addr) {
    my $ip = new NetAddr::IP $a;
    if ($a eq "$ip") {
	print "ok $count\n";
    }
    else {
	print "not ok $count\n";
    }
    ++ $count;

    if ($a eq $ip) {
	print "ok $count\n";
    }
    else {
	print "not ok $count\n";
    }
    ++ $count;

    if ($ip eq $a) {
	print "ok $count\n";
    }
    else {
	print "not ok $count\n";
    }
    ++ $count;

    if ($ip eq $ip) {
	print "ok $count\n";
    }
    else {
	print "not ok $count\n";
    }
    ++ $count;

    if ($ip == $ip) {
	print "ok $count\n";
    }
    else {
	print "not ok $count\n";
    }
    ++ $count;

}