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

Re: Where should a test for pp_divide behaviour go?

Thread Previous
From:
Hugo van der Sanden
Date:
August 20, 2001 06:06
Subject:
Re: Where should a test for pp_divide behaviour go?
Message ID:
200108201305.f7KD5vn18047@crypt.compulink.co.uk
Nicholas Clark <nick@ccl4.org> 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
:warnings.pm

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

Hugo

Thread Previous


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