diff options
author | Jarkko Hietaniemi <jhi@iki.fi> | 2001-05-29 15:05:38 +0000 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2001-05-29 15:05:38 +0000 |
commit | 6fa754dfb41b5b4adfbfa47a6edf34a2b20c0904 (patch) | |
tree | e89344a522ff76c0c0ed54d3f9d8d8c8ea30e767 | |
parent | 1d958aa95297aefb06eab911e266eee3836a2fcd (diff) | |
download | perl-6fa754dfb41b5b4adfbfa47a6edf34a2b20c0904.tar.gz |
Add test for Net::servent.
p4raw-id: //depot/perl@10289
-rw-r--r-- | MANIFEST | 2 | ||||
-rw-r--r-- | t/lib/1_compile.t | 2 | ||||
-rw-r--r-- | t/lib/net-sent.t | 38 |
3 files changed, 42 insertions, 0 deletions
@@ -1580,6 +1580,8 @@ t/lib/mimeqp.t see whether MIME::QuotedPrint works t/lib/ndbm.t See if NDBM_File works t/lib/net-hostent.t See if Net::hostent works t/lib/net-nent.t See if Net::netent works +t/lib/net-pent.t See if Net::protoent works +t/lib/net-sent.t See if Net::servtent works t/lib/next.t See if NEXT works t/lib/odbm.t See if ODBM_File works t/lib/opcode.t See if Opcode works diff --git a/t/lib/1_compile.t b/t/lib/1_compile.t index cf5a9c1f42..d99641d811 100644 --- a/t/lib/1_compile.t +++ b/t/lib/1_compile.t @@ -194,6 +194,8 @@ NDBM_File NEXT Net::hostent Net::netent +Net::protoent +Net::servent ODBM_File Opcode PerlIO diff --git a/t/lib/net-sent.t b/t/lib/net-sent.t new file mode 100644 index 0000000000..ef4a04dee8 --- /dev/null +++ b/t/lib/net-sent.t @@ -0,0 +1,38 @@ +#!./perl + +BEGIN { + chdir 't' if -d 't'; + @INC = '../lib'; +} + +BEGIN { + our $hasse; + eval { my @n = getservbyname "echo", "tcp" }; + $hasse = 1 unless $@ && $@ =~ /unimplemented/; + unless ($hasse) { print "1..0 # Skip: no getservbyname\n"; exit 0 } + use Config; + $hasse = 0 unless $Config{'i_netdb'} eq 'define'; + unless ($hasse) { print "1..0 # Skip: no netdb.h\n"; exit 0 } +} + +BEGIN { + our @servent = getservbyname "echo", "tcp"; # This is the function getservbyname. + unless (@servent) { print "1..0 # Skip: no echo service\n"; exit 0 } +} + +print "1..3\n"; + +use Net::servent; + +print "ok 1\n"; + +my $servent = getservbyname "echo", "tcp"; # This is the OO getservbyname. + +print "not " unless $servent->name eq $servent[0]; +print "ok 2\n"; + +print "not " unless $servent->port == $servent[2]; +print "ok 3\n"; + +# Testing pretty much anything else is unportable. + |