[m-rev.] for review: add comprehensive string__format tests

Fergus Henderson fjh at cs.mu.OZ.AU
Tue Nov 12 12:27:32 AEDT 2002


On 11-Nov-2002, Peter Ross <peter.ross at miscrit.be> wrote:
> Index: tests/general/string_format_c.exp
> ===================================================================
> RCS file: tests/general/string_format_c.exp
> diff -N tests/general/string_format_c.exp
> --- /dev/null	1 Jan 1970 00:00:00 -0000
> +++ tests/general/string_format_c.exp	11 Nov 2002 19:45:21 -0000
> @@ -0,0 +1,40 @@
> +    % +-0c:a
> +    % +-1c:a

Failures would be easier to debug if there was some character
at the start and end of the result, so that trailing spaces
show up more clearly.

> Index: tests/general/string_format_c.m
...
> +main -->
> +	{ Chars = [c('a')] },
> +	list__foldl(output_list(Chars), format_strings("c")).

It may be worth also testing ' '.

> Index: tests/general/string_format_e.m
> +main -->
> +	{ Floats = [f(0.0), f(-1.0), f(1.0), f(10.0), f(-10.0),
> +			f(100.0), f(-100.0), f(min), f(max)] },
> +	list__foldl(output_list(Floats), format_strings("e")),
> +	list__foldl(output_list(Floats), format_strings("E")).

It is also worth testing 
	- larger numbers which end in trailing zeros, e.g. 1.0E9
	- numbers which require rounding, e.g. +/- 5.555555555555555555555555
	- -min and -max
	- denormals, e.g. +/- min/2.0, 1.2345678 * min / 16.0, etc.

-- 
Fergus Henderson <fjh at cs.mu.oz.au>  |  "I have always known that the pursuit
The University of Melbourne         |  of excellence is a lethal habit"
WWW: <http://www.cs.mu.oz.au/~fjh>  |     -- the last words of T. S. Garp.
--------------------------------------------------------------------------
mercury-reviews mailing list
post:  mercury-reviews at cs.mu.oz.au
administrative address: owner-mercury-reviews at cs.mu.oz.au
unsubscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: unsubscribe
subscribe:   Address: mercury-reviews-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------



More information about the reviews mailing list