[m-rev.] Fix 64bit general/string_format_o testcase
Julien Fischer
juliensf at csse.unimelb.edu.au
Wed Jan 10 01:57:19 AEDT 2007
On Sun, 7 Jan 2007, Keri Harris wrote:
> The general/string_format_o testcase contains a bug in
> string_format_o.exp2: 'string.format("%#.0o", 0, String)' should
> return 'String = "0"'. However the general/string_format_o testcase
> indicates otherwise:
>
> $ grep '%#\.0o' string_format_x.exp
> %#.0o:''
>
> string.format relies on sprintf and the C standard for sprintf mentions:
>
> - #: For o conversion, it increases the precision, if and only if necessary,
> to force the ÿÿrst digit of the result to be a zero (if the value and
> precision are both 0, a single 0 is printed).
That particular expected output was a victim of the fact that quite a
lot of C library implementations get that particular conversion wrong.
(including I've just noticed the machine I'm writing this on :-( )
Thanks for the fix.
Julien.
More information about the reviews
mailing list