Permalink
Browse files

rakudo-fudge substr-rw.t

  • Loading branch information...
1 parent 7fa5f12 commit fb9e1c191c0c78b36d1958d90b93d136729d7a37 @moritz moritz committed May 15, 2012
Showing with 8 additions and 10 deletions.
  1. +8 −10 S32-str/substr-rw.t
View
@@ -16,11 +16,13 @@ sub l (Int $a) { my $l = $a; return $l }
#?pugs todo 'scalarrefs are not handled correctly'
$r = "boing";
+ #?rakudo todo 'NYI'
is($str, "boing ding", "assignment to reference modifies original");
is($r, "boing", '$r is consistent');
#?pugs todo 'scalarrefs are not handled correctly'
my $o = substr-rw($str, 3, 2);
+ #?rakudo 3 todo 'NYI'
is($o, "ng", "other ref to other lvalue");
$r = "foo";
#?pugs todo
@@ -31,17 +33,14 @@ sub l (Int $a) { my $l = $a; return $l }
}
-#?rakudo skip 'substr-rw as lvalue NYI'
{ # as lvalue, should work
my $str = "gorch ding";
substr-rw($str, 0, 5) = "gloop";
is($str, "gloop ding", "lvalue assignment modified original string");
};
-#?rakudo skip "substr-rw as lvalue NYI"
{ # as lvalue, using :=, should work
- #?rakudo 3 todo 'exception'
my $str = "gorch ding";
substr-rw($str, 0, 5) = "gloop";
@@ -53,23 +52,22 @@ sub l (Int $a) { my $l = $a; return $l }
$r = "boing";
is($str, "boing ding", "assignment to bound var modifies original");
#?pugs todo 'bug'
+ #?rakudo todo 'NYI'
is($r, "boing", 'bound $r is consistent');
my $o := substr-rw($str, 3, 2);
- #?rakudo 3 todo ' substr-rw lvalue binding'
is($o, "ng", "other bound var to other lvalue");
$r = "foo";
is($str, "foo ding", "lvalue ref size varies but still works");
#?pugs todo 'bug'
+ #?rakudo todo 'NYI'
is($o, " d", "other lvalue wiggled around");
};
-#?rakudo skip "substr-rw as lvalue NYI"
{
my $str = "gorch ding";
substr-rw($str, 0, l(5)) = "gloop";
-#?rakudo todo "substr-rw as lvalue"
is($str, "gloop ding", "lvalue assignment modified original string (substr-rw(Int, StrLen)).");
{
@@ -79,11 +77,13 @@ sub l (Int $a) { my $l = $a; return $l }
#?pugs todo 'scalarrefs are not handled correctly'
$$r = "boing";
+ #?rakudo todo 'NYI'
is($str, "boing ding", "assignment to reference modifies original (substr-rw(Int, StrLen)).");
is($$r, "boing", '$r is consistent (substr-rw(Int, StrLen)).');
#?pugs todo 'scalarrefs are not handled correctly'
my $o = \substr-rw($str, 3, l(2));
+ #?rakudo 3 todo 'NYI'
is($$o, "ng", "other ref to other lvalue (substr-rw(Int, StrLen)).");
$$r = "foo";
#?pugs todo
@@ -94,17 +94,14 @@ sub l (Int $a) { my $l = $a; return $l }
}
-#?rakudo skip 'substr-rw as lvalue NYI'
{ # as lvalue, should work
my $str = "gorch ding";
substr-rw($str, 0, l(5)) = "gloop";
is($str, "gloop ding", "lvalue assignment modified original string (substr-rw(Int, StrLen)).");
};
-#?rakudo skip 'substr-rw as lvalue NYI'
{ # as lvalue, using :=, should work
- #?rakudo 3 todo 'substr-rw as lvalue NYI'
my $str = "gorch ding";
substr-rw($str, 0, l(5)) = "gloop";
@@ -116,14 +113,15 @@ sub l (Int $a) { my $l = $a; return $l }
$r = "boing";
is($str, "boing ding", "assignment to bound var modifies original (substr-rw(Int, StrLen)).");
#?pugs todo 'bug'
+ #?rakudo todo 'NYI'
is($r, "boing", 'bound $r is consistent (substr-rw(Int, StrLen)).');
my $o := substr-rw($str, 3, l(2));
- #?rakudo 3 todo ' substr-rw lvalue binding'
is($o, "ng", "other bound var to other lvalue (substr-rw(Int, StrLen)).");
$r = "foo";
is($str, "foo ding", "lvalue ref size varies but still works (substr-rw(Int, StrLen)).");
#?pugs todo 'bug'
+ #?rakudo todo 'NYI'
is($o, " d", "other lvalue wiggled around (substr-rw(Int, StrLen)).");
};

0 comments on commit fb9e1c1

Please sign in to comment.