Mercurial > pub > Impl
comparison _test/Test/Lang.pm @ 175:9057e4b95d10
corrected cloning method
| author | sourcer |
|---|---|
| date | Wed, 05 Oct 2011 00:48:43 +0300 |
| parents | d920d2b70230 |
| children | 74c27daf2e7b |
comparison
equal
deleted
inserted
replaced
| 174:d920d2b70230 | 175:9057e4b95d10 |
|---|---|
| 72 | 72 |
| 73 assert( hashCompare( \%b, hashMerge(\%a,\%diff) ) ); | 73 assert( hashCompare( \%b, hashMerge(\%a,\%diff) ) ); |
| 74 | 74 |
| 75 }; | 75 }; |
| 76 | 76 |
| 77 test clone => { | 77 test clone => sub { |
| 78 | |
| 79 my $a; | |
| 80 | |
| 81 my $b = clone($a); | |
| 82 | |
| 83 assert(not defined $b); | |
| 84 | |
| 85 my $lp = { a => '1' }; | |
| 86 $lp->{b} = $lp; | |
| 87 | |
| 88 my $c = clone($lp); | |
| 89 | |
| 90 assert($c); | |
| 91 assert($c->{b}); | |
| 92 assert($c->{b} == $c); | |
| 78 | 93 |
| 79 }; | 94 }; |
| 80 | 95 |
| 81 1; | 96 1; |
