X-Git-Url: http://git.annexia.org/?a=blobdiff_plain;f=ocaml-calendar%2Ftest_ftime.ml;h=de60db80a0b2aee13b6dd3ef0c95fb1a71c4bbd0;hb=5a4e88c28b4724b9afad68a96c47206424b53a86;hp=fcddc3a108d634549040464dd08204c2052e17a9;hpb=5e12fb12ee052467f019c524f8f50e09d7ec8e29;p=fedora-mingw.git diff --git a/ocaml-calendar/test_ftime.ml b/ocaml-calendar/test_ftime.ml index fcddc3a..de60db8 100644 --- a/ocaml-calendar/test_ftime.ml +++ b/ocaml-calendar/test_ftime.ml @@ -49,8 +49,9 @@ test (is_am (make (- 34) 0 0.)) "is_am (- 34) 0 0";; test (not (is_am (make 34 0 0.))) "not (is_pm 34 0 0)";; let one_two_three = Period.make 1 2 3.;; -test (Period.to_seconds one_two_three = 3723.) "Period.to_seconds";; -test (Period.to_minutes one_two_three = 62.05) "Period.to_minutes";; +let eq f1 f2 = abs_float (f1 -. f2) < 1e-5;; +test (eq (Period.to_seconds one_two_three) 3723.) "Period.to_seconds";; +test (eq (Period.to_minutes one_two_three) 62.05) "Period.to_minutes";; test (Utils.Float.equal (Period.to_hours (Period.make 1 3 0.1)) 1.050028) "Period.to_hours";;