Index: src/pmc/resizablepmcarray.pmc =================================================================== --- src/pmc/resizablepmcarray.pmc (révision 41246) +++ src/pmc/resizablepmcarray.pmc (copie de travail) @@ -619,15 +619,11 @@ for (j = 0; j < n; ++j) { PMC *item1 = SELF.get_pmc_keyed_int(j); PMC *item2 = VTABLE_get_pmc_keyed_int(INTERP, value, j); - INTVAL result; if (item1 == item2) continue; - Parrot_mmd_multi_dispatch_from_c_args(INTERP, - "is_equal", "PP->I", item1, item2, &result); - - if (!result) + if (!VTABLE_is_equal(INTERP, item1, item2)) return 0; } Index: t/pmc/resizablepmcarray.t =================================================================== --- t/pmc/resizablepmcarray.t (révision 41246) +++ t/pmc/resizablepmcarray.t (copie de travail) @@ -21,7 +21,7 @@ .include 'fp_equality.pasm' .include 'test_more.pir' - plan(122) + plan(125) resize_tests() negative_array_size() @@ -49,6 +49,7 @@ method_forms_of_unshift_etc() sort_with_broken_cmp() addr_tests() + equality_tests() .end @@ -942,7 +943,34 @@ is($I0, $I1, 'Adding element to RPA keeps same addr') .end +.sub 'equality_tests' + .local pmc array1, array2, array3, array4 + array1 = new ['ResizablePMCArray'] + array2 = new ['ResizablePMCArray'] + array3 = new ['ResizablePMCArray'] + array1[0] = "Hello Parrot!" + array1[1] = 1664 + array1[2] = 2.718 + + $P0 = box "Hello Parrot!" + array2[0] = $P0 + $P0 = box 1664 + array2[1] = $P0 + $P0 = box 2.718 + array2[2] = $P0 + + array3[0] = "Goodbye Parrot!" + array3[1] = 1664 + array3[2] = 2.718 + + array4 = clone array1 + + is(array1, array2, 'Physically disjoint, but equal arrays') + is(array1, array4, 'Clones are equal') + isnt(array1, array3, 'Different arrays') +.end + # don't forget to change the test plan # Local Variables: