OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

office-comment message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]


Subject: Re: [office-comment] Comment on test case for LEFT()


On Saturday 13 January 2007 04:24, Eike Rathke wrote:
> Hi Brad,
>
> On Thursday, 2006-12-21 12:46:49 +1100, Brad Hards wrote:
> > Section 6.19.10 "Left" has this test case:
> >
> > Expression: =LEN(LEFT("xxx";-0.1))
> > Result: Error
> > Level: 1
> > Comment: It makes no sense to request a negative number of characters. 
> > Length is converted using INT, towards negative infinity, so Length
> > becomes -1
> >
> > That is a bit subtle, and doesn't just test LEFT(). In particular, it
> > will fail if the implicit conversion goes to 0 instead of -1.
>
> Exactly this should be part of the testcase, as the specification says
> that the parameter is converted to INT. If conversion to INT would not
> convert towards negative inifinity here, this testcase would not result
> in Error, the argument converted to 0 and an empty string returned.
>
> > Suggest that the expression should be: =LEFT("xxx";-1)
> > which would just test LEFT.
>
> And wouldn't test the constraint of the specific INT conversion.
My point is that testing the INT conversion is inappropriate for the test 
cases for LEFT(). That INT conversion should only be the test cases for 
INT().

At the very least, there should be a test case that just test the use of a 
negative integer. That tells you whether the problem is that LEFT() doesn't 
work with negative numbers or whether you integer conversion isn't correct.

Brad

 


[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]