[svn:parrot] r46932 - trunk/t/pmc
NotFound at svn.parrot.org
NotFound at svn.parrot.org
Mon May 24 00:34:03 UTC 2010
Author: NotFound
Date: Mon May 24 00:34:02 2010
New Revision: 46932
URL: https://trac.parrot.org/parrot/changeset/46932
Log:
test splice with negative offsets
Modified:
trunk/t/pmc/resizablestringarray.t
Modified: trunk/t/pmc/resizablestringarray.t
==============================================================================
--- trunk/t/pmc/resizablestringarray.t Mon May 24 00:32:41 2010 (r46931)
+++ trunk/t/pmc/resizablestringarray.t Mon May 24 00:34:02 2010 (r46932)
@@ -23,7 +23,7 @@
.include 'test_more.pir'
# set a test plan
- plan(261)
+ plan(263)
'size/resize'()
'clone'()
@@ -1343,6 +1343,7 @@
.SpliceMadeEasy({ splice $P1, $P2, 0, 2 }, "ABCDE345", "splice, replace at beginning")
.SpliceMadeEasy({ splice $P1, $P2, 2, 2 }, "12ABCDE5", "splice, replace in middle")
.SpliceMadeEasy({ splice $P1, $P2, 3, 2 }, "123ABCDE", "splice, replace at end")
+ .SpliceMadeEasy({ splice $P1, $P2, -3, 2 }, "12ABCDE5", "splice, replace in middle start from end")
.SpliceMadeEasy({
$P2 = new ['ResizableStringArray']
splice $P1, $P2, 2, 2
@@ -1355,6 +1356,20 @@
$P1 = new ['ResizableStringArray']
$P1[0] = "1"
+ $P2 = new ['ResizableStringArray']
+ $P2[0] = 'A'
+ $I0 = 0
+ push_eh handle_negtoobig
+ splice $P1, $P2, -10, 1
+ goto after_negtoobig
+handle_negtoobig:
+ inc $I0
+after_negtoobig:
+ pop_eh
+ is($I0, 1, 'splice, negative offset too long throws')
+
+ $P1 = new ['ResizableStringArray']
+ $P1[0] = "1"
$P1[1] = "2"
$P1[2] = "3"
$P1[3] = "4"
More information about the parrot-commits
mailing list