[svn:parrot] r41319 - trunk/t/op

fperrad at svn.parrot.org fperrad at svn.parrot.org
Thu Sep 17 12:08:11 UTC 2009


Author: fperrad
Date: Thu Sep 17 12:08:11 2009
New Revision: 41319
URL: https://trac.parrot.org/parrot/changeset/41319

Log:
add a test that demonstrates TT #1007 in PIR

Modified:
   trunk/t/op/string.t

Modified: trunk/t/op/string.t
==============================================================================
--- trunk/t/op/string.t	Thu Sep 17 11:58:14 2009	(r41318)
+++ trunk/t/op/string.t	Thu Sep 17 12:08:11 2009	(r41319)
@@ -7,7 +7,7 @@
 use lib qw( . lib ../lib ../../lib );
 
 use Test::More;
-use Parrot::Test tests => 167;
+use Parrot::Test tests => 168;
 use Parrot::Config;
 
 =head1 NAME
@@ -266,6 +266,23 @@
 length
 OUTPUT
 
+pir_output_is( <<'CODE', <<'OUTPUT', 'neg substr offset', todo => "TT #1007" );
+.sub 'main' :main
+    $S0 = "path_abc/abc"
+    $I0 = length $S0
+    $S1 = "abc"
+    $I1 = length $S1
+    $I2 = - $I1
+    $S2 = substr $S0, $I2, $I1
+    say $S2
+#    $I3 = $I0 - $I1
+#    $S3 = substr $S0, 0, $I3
+#    say $S3
+.end
+CODE
+path_abc/
+OUTPUT
+
 # This asks for substring that shouldn't be allowed...
 pasm_error_output_like( <<'CODE', <<'OUTPUT', 'substr OOB' );
     set S0, "A string of length 21"


More information about the parrot-commits mailing list