diff _test/Test/Lang.pm @ 175:9057e4b95d10

corrected cloning method
author sourcer
date Wed, 05 Oct 2011 00:48:43 +0300
parents d920d2b70230
children 74c27daf2e7b
line wrap: on
line diff
--- a/_test/Test/Lang.pm	Tue Oct 04 17:55:38 2011 +0400
+++ b/_test/Test/Lang.pm	Wed Oct 05 00:48:43 2011 +0300
@@ -74,7 +74,22 @@
 	
 };
 
-test clone => {
+test clone => sub {
+	
+	my $a;
+	
+	my $b = clone($a);
+	
+	assert(not defined $b);
+	
+	my $lp = { a => '1' };
+	$lp->{b} = $lp;
+	
+	my $c = clone($lp); 
+	
+	assert($c);
+	assert($c->{b});
+	assert($c->{b} == $c);
 	
 };