[svn:parrot] r49488 - trunk/t/pmc

dukeleto at svn.parrot.org dukeleto at svn.parrot.org
Sun Oct 10 06:26:39 UTC 2010


Author: dukeleto
Date: Sun Oct 10 06:26:39 2010
New Revision: 49488
URL: https://trac.parrot.org/parrot/changeset/49488

Log:
[pmc] Add tests for converting Boolean PMC to a numeric, which should bring the coverage up to 100%

Modified:
   trunk/t/pmc/boolean.t

Modified: trunk/t/pmc/boolean.t
==============================================================================
--- trunk/t/pmc/boolean.t	Sun Oct 10 05:38:01 2010	(r49487)
+++ trunk/t/pmc/boolean.t	Sun Oct 10 06:26:39 2010	(r49488)
@@ -17,9 +17,11 @@
 
 =cut
 
+.include 'fp_equality.pasm'
+
 .sub main :main
     .include 'test_more.pir'
-    plan(31)
+    plan(33)
     init_null_tests()
     init_int_tests()
     instantiate_tests()
@@ -82,6 +84,17 @@
     set $P0, $N0
     set $I0, $P0
     is($I0, 1, "Boolean converts non-0 num to true")
+
+    $P0 = 1
+    $N1 = $P0
+
+    .fp_eq_ok($N1, 1, 'Boolean converts true value to a numeric')
+
+    $P0 = 0
+    $N1 = $P0
+
+    .fp_eq_ok($N1, 0, 'Boolean converts false value to a numeric')
+
 .end
 
 .sub string_tests


More information about the parrot-commits mailing list