develooper Front page | perl.perl5.porters | Postings from November 2000

Re: [ID 20001128.002] what's the point of example code if it is buggy?

Thread Previous | Thread Next
From:
Nicholas Clark
Date:
November 28, 2000 07:54
Subject:
Re: [ID 20001128.002] what's the point of example code if it is buggy?
Message ID:
20001128155356.D18829@plum.flirble.org
On Tue, Nov 28, 2000 at 09:43:40AM -0600, Jarkko Hietaniemi wrote:
> On Tue, Nov 28, 2000 at 11:16:57AM +0000, Nicholas Clark wrote:

> > 3: Net::hostent doesn't have a regression test to detected that it's shagged.
> 
> Writing a portable test that still tests anything useful for the
> gethost* is tough.  Remember that the contents or the existence of the
> /etc/hosts file might be largely irrelevant to to results of the
> gethost* calls.

$ cat t/lib/net_hostent.t 
#!./perl -w
BEGIN { $| = 1; print "1..1\n"; }
END {print "not ok 1\n" unless $loaded;}
use Net::hostent;
$loaded = 1;
print "ok 1\n";

It's better than nothing? (cribbed from h2xs)

Nicholas Clark


Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About