develooper Front page | perl.perl5.porters | Postings from August 2001

Re: Where should a test for pp_divide behaviour go?

Thread Previous
Hugo van der Sanden
August 20, 2001 06:06
Re: Where should a test for pp_divide behaviour go?
Message ID:
Nicholas Clark <> wrote:
:Unlike pp_add, pp_subtract and pp_multiply, pp_divide doesn't currently
:preserve 64 bit integers. I have a patch to do so that I'm currently testing,
:and it would be possible to do the zero check before touching the left SV.
:This would change the warnings issued in the corner case where the left
:argument is uninitialized (or not a number)

I'm not convinced it greatly matters, but I think it makes sense that the
behaviour should be consistent across different types of number.

:> Looks like a test of the presence/absence of a warning to me.
:Which would be t/lib/warnings/sv ?
:Except that that file currently tests only warnings generated in sv.c
:*If* we decide that perl should maintain current behaviour, then a test
:would be for a warning from sv.c and then a fatal error from pp.c, which
:is a bit more messy than anything I can currently find in tests for

Can you not catch the error with 'eval', then just check the warning?


Thread Previous Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About