Cross Reference: libnet_t.pl
xref
: /
osnet-11
/
usr
/
src
/
cmd
/
perl
/
5.8.4
/
distrib
/
lib
/
Net
/
t
/
libnet_t.pl
Home
History
Annotate
Line#
Navigate
Download
Search
only in
./
my
$
number
=
0
;
sub
ok
{
my
($
condition
, $
name
) = @_;
my
$
message
= $
condition
?
"ok "
:
"not ok "
;
$
message
.= ++$
number
;
$
message
.=
" # $name"
if
defined
$
name
;
print
$
message
,
"\n"
;
return
$
condition
;
}
sub
is
{
my
($
got
, $
expected
, $
name
) = @_;
for
($
got
, $
expected
) {
$_ =
'undef'
unless
defined
$_;
}
unless
(
ok
($
got
eq
$
expected
, $
name
)) {
warn
"Got: '$got'\nExpected: '$expected'\n"
.
join
(
' '
,
caller
) .
"\n"
;
}
}
sub
skip
{
my
($
reason
, $
num
) = @_;
$
reason
||=
''
;
$
number
||=
1
;
for
(
1
.. $
num
) {
$
number
++;
print
"ok $number # skip $reason\n"
;
}
}
1
;