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()


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.

  Eike

-- 
 OpenOffice.org Engineering at Sun: http://blogs.sun.com/GullFOSS


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