Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Test for .perl on mutually referencing objects
RT #122286
  • Loading branch information
niner committed Sep 24, 2015
1 parent 95a6e77 commit a9f090c
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions S02-names-vars/perl.t
Expand Up @@ -92,6 +92,7 @@ my @tests = (
".perl worked correctly on a mixed arrayref/hashref recursive structure";
}

# RT #124242
{
class Bug {
has @.myself;
Expand All @@ -105,6 +106,32 @@ my @tests = (
ok("survived saying a self-referencing object");
}

# RT #122286
{
class Location {...}
class Item {
has Location $.loc is rw;
method locate (Location $l) {
self.loc=$l;
}
method whereis () {
return self.loc;
}
}
class Location {
has Item @.items;
method put (Item $item) {
push(@.items, $item);
}
}
my $i1=Item.new;
my $l1=Location.new;
$l1.put($i1);
$i1.locate($l1);
say $i1.whereis;
ok("survived saying two mutually referencing objects");
}

{
# test a bug reported by Chewie[] - apparently this is from S03
is(EVAL((("f","oo","bar").keys.List).perl), <0 1 2>, ".perl on a .keys list");
Expand Down

0 comments on commit a9f090c

Please sign in to comment.