summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorXavier Leroy <xavier.leroy@inria.fr>2003-11-21 16:06:52 +0000
committerXavier Leroy <xavier.leroy@inria.fr>2003-11-21 16:06:52 +0000
commitc507d2bd41ac4dd356064479e1a390a0edac4969 (patch)
tree83519595b5df66001b35b993c7b6726be2850fb1
parent137e9f9c5cf9bad3d2475af7a18d99ba1af2cdbf (diff)
Ajout tests sur nan
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@5965 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
-rw-r--r--test/Moretest/equality.ml14
1 files changed, 13 insertions, 1 deletions
diff --git a/test/Moretest/equality.ml b/test/Moretest/equality.ml
index 171735d1d..05e651236 100644
--- a/test/Moretest/equality.ml
+++ b/test/Moretest/equality.ml
@@ -56,4 +56,16 @@ let _ =
test 29 0 (compare (mkleftlist 1000) (mkleftlist 1000));
test 30 0 (compare (mktree 12) (mktree 12));
test 31 true (x = f []);
- test 32 true (stdout <> stderr)
+ test 32 true (stdout <> stderr);
+ test 33 (-1) (compare nan 0.0);
+ test 34 (-1) (compare nan neg_infinity);
+ test 35 0 (compare nan nan);
+ test 36 (-1) (compare (0.0, nan) (0.0, 0.0));
+ test 37 (-1) (compare (0.0, nan) (0.0, neg_infinity));
+ test 38 0 (compare (nan, 0.0) (nan, 0.0));
+ let cmpgen x y = (x=y, x<>y, x<y, x<=y, x>y, x>=y) in
+ let cmpfloat (x:float) (y:float) = (x=y, x<>y, x<y, x<=y, x>y, x>=y) in
+ test 39 (false,true,false,false,false,false) (cmpgen nan nan);
+ test 40 (false,true,false,false,false,false) (cmpgen nan 0.0);
+ test 41 (false,true,false,false,false,false) (cmpfloat nan nan);
+ test 42 (false,true,false,false,false,false) (cmpfloat nan 0.0)