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/Lite/t/over_math.t
#use diagnostics;
use NetAddr::IP::Lite;

$| = 1;

print "1..7\n";

my $test = 1;
sub ok() {
  print 'ok ',$test++,"\n";
}

my $ip	= new NetAddr::IP::Lite('0.0.0.4/24');

## test '+'
my $exp = '0.0.0.132/24';
my $nip = $ip + 128;
print 'got: ',$nip," exp: $exp\nnot "
	unless $nip eq $exp;
&ok;

## test '+' wrap around
$nip = $ip + 257;
$exp = '0.0.0.5/24';
print 'got: ',$nip," exp: $exp\nnot "
	unless $nip eq $exp;
&ok;

## test '-' and wrap
$nip = $ip - 10;
$exp = '0.0.0.250/24';
print 'got: ',$nip," exp: $exp\nnot "
	unless $nip eq $exp;
&ok;

## test '++' post
$nip++;
$exp = '0.0.0.251/24';
print 'got: ',$nip," exp: $exp\nnot "
	unless $nip eq $exp;
&ok;

## test '++' pre
++$nip;
$exp = '0.0.0.252/24';
print 'got: ',$nip," exp: $exp\nnot "
	unless $nip eq $exp;
&ok;

## test '--' post
$ip--;
$exp = '0.0.0.3/24';
print 'got: ',$ip," exp: $exp\nnot "
	unless $ip eq $exp;
&ok;

## test '--' pre
--$ip;
$exp = '0.0.0.2/24';
print 'got: ',$ip," exp: $exp\nnot "
	unless $ip eq $exp;
&ok;