[m-rev.] diff: add more tests for string__to_float
Fergus Henderson
fjh at cs.mu.OZ.AU
Wed Oct 23 23:54:27 AEST 2002
Estimated hours taken: 0.1
tests/general/string_to_float.m:
tests/general/string_to_float.exp:
Add some additional tests of string_to_float.
Workspace: /home/ceres/fjh/ws-ceres2/mercury
Index: tests/general/string_to_float.exp
===================================================================
RCS file: /home/mercury1/repository/tests/general/string_to_float.exp,v
retrieving revision 1.1
diff -u -d -r1.1 string_to_float.exp
--- tests/general/string_to_float.exp 12 Feb 2002 01:39:30 -0000 1.1
+++ tests/general/string_to_float.exp 23 Oct 2002 13:50:30 -0000
@@ -5,3 +5,13 @@
string__to_float(" 1.23") FAILS
string__to_float("1.23 ") FAILS
string__to_float(" 1.23 ") FAILS
+string__to_float("1") = 1.000000
+string__to_float("-1") = -1.000000
+string__to_float("+1") = 1.000000
+string__to_float("0") = 0.000000
+string__to_float("+0") = 0.000000
+string__to_float("-0") = -0.000000
+string__to_float("-") FAILS
+string__to_float("+") FAILS
+string__to_float(" ") FAILS
+string__to_float("") FAILS
Index: tests/general/string_to_float.m
===================================================================
RCS file: /home/mercury1/repository/tests/general/string_to_float.m,v
retrieving revision 1.1
diff -u -d -r1.1 string_to_float.m
--- tests/general/string_to_float.m 12 Feb 2002 01:39:30 -0000 1.1
+++ tests/general/string_to_float.m 23 Oct 2002 13:49:32 -0000
@@ -32,7 +32,17 @@
test("x1.23x"),
test(" 1.23"),
test("1.23 "),
- test(" 1.23 ").
+ test(" 1.23 "),
+ test("1"),
+ test("-1"),
+ test("+1"),
+ test("0"),
+ test("+0"),
+ test("-0"),
+ test("-"),
+ test("+"),
+ test(" "),
+ test("").
:- pred test(string::in, io::di, io::uo) is det.
--
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