Skip to content

Commit

Permalink
Merge pull request #30 from samuraisam/sam/addional-clone-tests
Browse files Browse the repository at this point in the history
Rename test classes for posterity (and to avoid name collisions)
  • Loading branch information
Samuel Sutch committed Jun 21, 2013
2 parents 79129a1 + 5ef80e3 commit 2611f3d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions S12-attributes/clone.t
Original file line number Diff line number Diff line change
Expand Up @@ -68,19 +68,19 @@ is($val2, 42, '... cloned object has proper attr value');
# test cloning of array and hash attributes
{
# array
class A {
class ArrTest {
has @.array;
}
my $a1 = A.new(:array<a b>);
my $a1 = ArrTest.new(:array<a b>);
my $a2 = $a1.clone(:array<c d>);
is_deeply $a1.array, ['a', 'b'], 'original object has its original array';
is_deeply $a2.array, ['c', 'd'], 'cloned object has the newly-provided array';

# hash
class B {
class HshTest {
has %.hash;
}
my $b1 = B.new(hash=>{'a' => 'b'});
my $b1 = HshTest.new(hash=>{'a' => 'b'});
my $b2 = $b1.clone(hash=>{'c' => 'd'});
is_deeply $b1.hash, {'a' => 'b'}, 'original object has its original hash';
is_deeply $b2.hash, {'c' => 'd'}, 'cloned object has the newly-provided hash';
Expand Down

0 comments on commit 2611f3d

Please sign in to comment.