develooper Front page | perl.perl5.porters | Postings from September 2005

Re: Untested builtins

Thread Previous | Thread Next
From:
Steven Schubiger
Date:
September 27, 2005 03:12
Subject:
Re: Untested builtins
Message ID:
20050926172513.GA17663@accognoscere.homeunix.org
On Mon, Aug 08, 2005 at 11:15:08AM +0100, Nicholas Clark wrote:
> On Mon, Aug 08, 2005 at 11:46:47AM +0200, Dominic Dunlop wrote:
> > In a trawl through all the .t files in bleadperl for uses (rather  
> > than just mentions) of Perl builtins, I find the following are not used:
> > 
> > endhostent
> > endnetent
> > endprotoent
> > endservent
> > gethostent
> > getnetbyaddr
> > getnetent
> > getprotobynumber
> > getprotoent
> > getservbyport
> > getservent
> > getsockname
> > getsockopt
> > readpipe
> > seekdir
> > sethostent
> > setnetent
> > setprotoent
> > setservent
> > setsockopt
> > 
> > Does anybody know a reason besides "nobody got around to it yet" for  
> > this? For example, if we can't rely on stuff like
> 
> For some of them (readpipe, seekdir) I'd suspect it's round tuits.
> (TPF have some, if you need them. Not sure what they'd cost to post)
> 
> The others might start being fun. Although it might be viable to write tests
> that start with something simple (eg trying to get 'localhost', if that
> fails, skip all the tests, else start trying more advanced things)
> 
> Nicholas Clark

Would it be sensible to say that in the case of getprotoent() it would make
sense to provide a default structured data set and compare it deeply (is adding
some Test::* modules to the core therefore considered thoughtful enough?) against 
the results of getprotoent()? Or should we go by picking certain entries, that we 
expect to be consistent on all systems?

Wouldn't former one fail on some systems that define their entries in differing
order, whereas latter one could succeed?

-- 
Steven Schubiger

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