This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Sync file with libnet-1.0901-tobe
[perl5.git] / lib / Net / t / libnet_t.pl
CommitLineData
c8570720
GB
1
2my $number = 0;
3sub ok {
4 my ($condition, $name) = @_;
5
6 my $message = $condition ? "ok " : "not ok ";
7 $message .= ++$number;
8 $message .= " # $name" if defined $name;
9 print $message, "\n";
10 return $condition;
11}
12
13sub is {
14 my ($got, $expected, $name) = @_;
15
16 for ($got, $expected) {
17 $_ = 'undef' unless defined $_;
18 }
19
20 unless (ok($got eq $expected, $name)) {
21 warn "Got: '$got'\nExpected: '$expected'\n" . join(' ', caller) . "\n";
22 }
23}
24
25sub skip {
26 my ($reason, $num) = @_;
27 $reason ||= '';
28 $number ||= 1;
29
30 for (1 .. $num) {
31 $number++;
32 print "ok $number # skip $reason\n";
33 }
34}
35
361;
37