Files
mercury/tests/hard_coded/write_binary.exp
Ian MacLarty 067c703c56 Fix a bug in MR_sprintf_float where it would convert 1.8e-10
runtime/mercury_float.c:
    Fix a bug in MR_sprintf_float where it would convert 1.8e-10
    into "1.80000000000000e-1" instead of "1.8e-10".

    The problem was that it was stripping the zeros off the end of the string
    produced by sprintf without considering the case where the output
    was in scientific notation.

    The fix is to remove the `#' from the sprintf format string and then to
    append ".0" to the string if there is no "." or "e".

tests/general/float_roundtrip.m:
tests/general/float_roundtrip.exp:
    Add regression test.

tests/hard_coded/deep_copy.exp:
tests/hard_coded/expand.exp:
tests/hard_coded/float_reg.exp:
tests/hard_coded/write.exp:
tests/hard_coded/write_binary.exp:
tests/hard_coded/write_reg1.exp:
tests/hard_coded/write_xml.exp:
    Update the expected output of these tests as trailing zeros are now
    also removed from the base part of scientific notation float strings.
2010-07-16 07:19:12 +00:00

152 lines
2.1 KiB
Plaintext

TESTING TERMS WITH OPERATORS
ok... test passed:
var("X") + int(3) * var("X^2") ; (type)
var("X") + int(3) * var("X^2") ; (type)
ok... test passed:
{ type }
{ type }
ok... test passed:
{ ':-' }
{ ':-' }
ok... test passed:
':-'
':-'
ok... test passed:
{ blah }
{ blah }
ok... test passed:
blah ; (type), (type) * blah ; (type)
blah ; (type), (type) * blah ; (type)
ok... test passed:
((blah ; blah), blah) * blah ; blah
((blah ; blah), blah) * blah ; blah
ok... test passed:
(type) * blah ; (type)
(type) * blah ; (type)
TESTING DISCRIMINATED UNIONS
ok... test passed:
one
one
ok... test passed:
two
two
ok... test passed:
three
three
ok... test passed:
apple([9, 5, 1])
apple([9, 5, 1])
ok... test passed:
banana([three, one, two])
banana([three, one, two])
ok... test passed:
zop(3.3, 2.03)
zop(3.3, 2.03)
ok... test passed:
zip(3, 2)
zip(3, 2)
ok... test passed:
zap(3, -2.111)
zap(3, -2.111)
ok... test passed:
wombat
wombat
ok... test passed:
foo
foo
TESTING POLYMORPHISM
ok... test passed:
poly_one([2399.3])
poly_one([2399.3])
ok... test passed:
poly_two(3)
poly_two(3)
ok... test passed:
poly_three(3.33, 4, poly_one(9.11))
poly_three(3.33, 4, poly_one(9.11))
TESTING BUILTINS
ok... test passed:
ok... test passed:
Hello, world
Hello, world
ok... test passed:
Foo%sFoo
Foo%sFoo
ok... test passed:
"
"
ok... test passed:
a
a
ok... test passed:
&
&
ok... test passed:
.
.
ok... test passed:
%
%
ok... test passed:
ok... test passed:
ok... test passed:
ok... test passed:
\
\
ok... test passed:
*
*
ok... test passed:
/
/
ok... test passed:
3.14159
3.14159
ok... test passed:
1.128324983e-21
1.128324983e-21
ok... test passed:
2.23954899e+23
2.23954899e+23
ok... test passed:
-65
-65
ok... test passed:
4
4
next text is expected to fail:
test failed:
exception(univ_cons("error reading term back in again"))
'<<predicate>>'
TESTING OTHER TYPES
ok... test passed:
var(1)
var(1)
ok... test passed:
var_supply(0)
var_supply(0)
ok... test passed:
var_supply(1)
var_supply(1)
ok... test passed:
empty
empty
ok... test passed:
qwerty(4)
qwerty(4)
ok... test passed:
array([1, 2, 3, 4])
array([1, 2, 3, 4])