[svn:parrot] r41259 - in trunk: src/pmc t/pmc

bacek at svn.parrot.org bacek at svn.parrot.org
Mon Sep 14 10:07:16 UTC 2009


Author: bacek
Date: Mon Sep 14 10:07:15 2009
New Revision: 41259
URL: https://trac.parrot.org/parrot/changeset/41259

Log:
[core] Implement Undef.logical_not. TT#816.

Modified:
   trunk/src/pmc/undef.pmc
   trunk/t/pmc/undef.t

Modified: trunk/src/pmc/undef.pmc
==============================================================================
--- trunk/src/pmc/undef.pmc	Mon Sep 14 09:56:40 2009	(r41258)
+++ trunk/src/pmc/undef.pmc	Mon Sep 14 10:07:15 2009	(r41259)
@@ -208,6 +208,20 @@
 
 /*
 
+=item C<INTVAL logical_not()>
+
+Returns 1.
+
+=cut
+
+*/
+
+    VTABLE INTVAL logical_not() {
+        return 1;
+    }
+
+/*
+
 =item C<void share()>
 
 Unknown. (TODO)

Modified: trunk/t/pmc/undef.t
==============================================================================
--- trunk/t/pmc/undef.t	Mon Sep 14 09:56:40 2009	(r41258)
+++ trunk/t/pmc/undef.t	Mon Sep 14 10:07:15 2009	(r41259)
@@ -19,7 +19,7 @@
 .sub main :main
     .include 'test_more.pir'
 
-    plan(22)
+    plan(23)
 
     morph_to_string()
     undef_pmc_is_false()
@@ -49,9 +49,18 @@
     pmc1 = new ['Undef']
     if pmc1 goto PMC1_IS
       ok( 1, 'PMC Undef created by new is false' )
-      .return()
+      goto logical_not
     PMC1_IS:
     ok( 0, 'PMC Undef created by new is false' )
+
+  logical_not:
+    unless pmc1 goto logical_not_passed
+    ok( 0, 'logical_not of PMC Undef created by new is false' )
+    goto done
+  logical_not_passed:
+    ok( 1, 'logical_not of PMC Undef created by new is true' )
+
+  done:
 .end
 
 .sub undef_pmc_is_not_defined


More information about the parrot-commits mailing list