summaryrefslogtreecommitdiff
path: root/t/deep-objects.t
diff options
context:
space:
mode:
Diffstat (limited to 't/deep-objects.t')
-rw-r--r--t/deep-objects.t28
1 files changed, 28 insertions, 0 deletions
diff --git a/t/deep-objects.t b/t/deep-objects.t
new file mode 100644
index 0000000..a2c9702
--- /dev/null
+++ b/t/deep-objects.t
@@ -0,0 +1,28 @@
+#!/usr/bin/perl -w
+
+use strict;
+use warnings;
+# use diagnostics;
+
+eval 'use Clone';
+($@) ?
+ do {
+ print "1..0 # Skipping no Clone found\n";
+ exit(0);
+ } :
+ eval 'use Test::More tests => 1;';
+
+use Data::Compare;
+
+my $c = bless { foo => 1 }, 'Foo';
+my $d = bless { c => $c }, "Foo::D";
+my $e = bless { d => $d }, "Foo::E";
+my $f = bless { e => $e }, "Foo::F";
+my $g = bless { f => $f }, "Foo::G";
+my $h = bless { g => $g }, "Foo::H";
+my $i = bless { h => $h }, "Foo::I";
+my $j = bless { i => $i }, "Foo::J";
+my $k = Clone::clone $j;
+
+Compare($j, $k);
+ok(Compare($j, $k), 'Can compare deeply-nested objecty jibber-jabber');