[svn:parrot] r48468 - branches/gc_threshold_tuning/t/op

chromatic at svn.parrot.org chromatic at svn.parrot.org
Sat Aug 14 00:32:20 UTC 2010


Author: chromatic
Date: Sat Aug 14 00:32:20 2010
New Revision: 48468
URL: https://trac.parrot.org/parrot/changeset/48468

Log:
test string split with null args

Modified:
   branches/gc_threshold_tuning/t/op/string.t

Modified: branches/gc_threshold_tuning/t/op/string.t
==============================================================================
--- branches/gc_threshold_tuning/t/op/string.t	Sat Aug 14 00:32:16 2010	(r48467)
+++ branches/gc_threshold_tuning/t/op/string.t	Sat Aug 14 00:32:20 2010	(r48468)
@@ -121,6 +121,7 @@
     test_find_encoding()
     test_assign()
     assign_and_globber()
+    split_on_null_string()
     split_on_empty_string()
     split_on_non_empty_string()
     test_join()
@@ -1388,6 +1389,28 @@
     is( $S5, "JAPH", 'assign & globber' )
 .end
 
+.sub split_on_null_string
+    .local string s, delim
+    .local pmc p
+    .local int i
+    null s
+    null delim
+    split p, s, delim
+    i = isnull p
+    is(i, 1, 'split on null string and delim')
+
+    s = 'foo'
+    split p, s, delim
+    i = isnull p
+    is(i, 1, 'split on null delim')
+
+    null s
+    delim = 'bar'
+    split p, s, delim
+    i = isnull p
+    is(i, 1, 'split on null string')
+.end
+
 .sub split_on_empty_string
     split $P1, "", ""
     set $I1, $P1


More information about the parrot-commits mailing list