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

NotFound at svn.parrot.org NotFound at svn.parrot.org
Wed Jun 2 17:05:15 UTC 2010


Author: NotFound
Date: Wed Jun  2 17:05:14 2010
New Revision: 47304
URL: https://trac.parrot.org/parrot/changeset/47304

Log:
tests for RPA delete_keyed, exists_keyed and get_repr vtables

Modified:
   trunk/t/pmc/resizablepmcarray.t

Modified: trunk/t/pmc/resizablepmcarray.t
==============================================================================
--- trunk/t/pmc/resizablepmcarray.t	Wed Jun  2 14:06:11 2010	(r47303)
+++ trunk/t/pmc/resizablepmcarray.t	Wed Jun  2 17:05:14 2010	(r47304)
@@ -21,7 +21,7 @@
     .include 'fp_equality.pasm'
     .include 'test_more.pir'
 
-    plan(139)
+    plan(142)
 
     resize_tests()
     negative_array_size()
@@ -43,6 +43,8 @@
     pop_empty()
     multikey_access()
     exists_and_defined()
+    delete_keyed()
+    get_rep()
     append_tests()
     splice_tests()
     splice_replace1()
@@ -688,6 +690,9 @@
     is(ex, 1, "element at idx 0 exists")
     def = defined array[0]
     is(def, 1, "element at idx 0 is defined")
+    $P0 = new 'Integer', 0
+    ex = exists array[$P0]
+    is(ex, 1, "element at PMC idx 0 exists")
 
     ## bounds checking: upper (7)
     ex = exists array[7]
@@ -732,6 +737,26 @@
     is(def, 0, "element at idx 5 is not defined")
 .end
 
+.sub delete_keyed
+    .local pmc array
+    array = new ['ResizablePMCArray']
+    push array, 'a'
+    push array, 'b'
+    push array, 'c'
+    $P0 = new 'Integer', 1
+    delete array[$P0]
+    $S0 = array[1]
+    is($S0, 'c', 'delete_keyed with PMC key')
+.end
+
+.sub get_rep
+    .local pmc array
+    array = new ['ResizablePMCArray']
+    push array, 'a'
+    push array, 'b'
+    $S0 = get_repr array
+    like($S0, '[.*a.*\,.*b.*]', 'get_repr')
+.end
 
 .sub append_tests
 


More information about the parrot-commits mailing list