[svn:parrot] r40496 - in trunk: . t/include

dukeleto at svn.parrot.org dukeleto at svn.parrot.org
Wed Aug 12 03:35:36 UTC 2009


Author: dukeleto
Date: Wed Aug 12 03:35:32 2009
New Revision: 40496
URL: https://trac.parrot.org/parrot/changeset/40496

Log:
[t] Add tests for fp_eq_ok in runtime/parrot/include/fp_equality.pasm

Added:
   trunk/t/include/
   trunk/t/include/fp_equality.t
Modified:
   trunk/MANIFEST

Modified: trunk/MANIFEST
==============================================================================
--- trunk/MANIFEST	Tue Aug 11 22:19:23 2009	(r40495)
+++ trunk/MANIFEST	Wed Aug 12 03:35:32 2009	(r40496)
@@ -1694,6 +1694,7 @@
 t/examples/subs.t                                           [test]
 t/examples/tutorial.t                                       [test]
 t/harness                                                   [test]
+t/include/fp_equality.t                                     [test]
 t/library/cgi_query_hash.t                                  [test]
 t/library/coroutine.t                                       [test]
 t/library/dumper.t                                          [test]

Added: trunk/t/include/fp_equality.t
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ trunk/t/include/fp_equality.t	Wed Aug 12 03:35:32 2009	(r40496)
@@ -0,0 +1,43 @@
+#! parrot
+# Copyright (C) 2009, Parrot Foundation.
+# $Id$
+
+=head1 NAME
+
+t/include/fp_equality.t - Test runtime/parrot/include/fp_equality.pasm
+
+=head1 SYNOPSIS
+
+        % prove t/include/fp_equality.t
+
+=head1 DESCRIPTION
+
+Tests fp_* functions.
+
+=cut
+
+.sub main :main
+    .include 'fp_equality.pasm'
+    .include 'test_more.pir'
+    .local num epsilon, zplus, zminus
+    .local num oplus, ominus
+    plan(4)
+    epsilon = 0.00000005
+    oplus  = 1 + epsilon
+    ominus = 1 - epsilon
+    zplus  = 0 + epsilon
+    zminus = 0 - epsilon
+
+    .fp_eq_ok(zplus, 0, 'zero')
+    .fp_eq_ok(0, zplus, 'zero')
+
+    .fp_eq_ok(oplus, 1, 'one')
+    .fp_eq_ok(1, oplus, 'one')
+
+.end
+
+# Local Variables:
+#   mode: pir
+#   fill-column: 100
+# End:
+# vim: expandtab shiftwidth=4 ft=pir:


More information about the parrot-commits mailing list