summaryrefslogtreecommitdiff
path: root/t/oo.t
diff options
context:
space:
mode:
authorLorry Tar Creator <lorry-tar-importer@lorry>2014-12-10 13:34:52 +0000
committerLorry Tar Creator <lorry-tar-importer@lorry>2014-12-10 13:34:52 +0000
commit8fddd4400d09891094843fe9e77fec74e4510c67 (patch)
tree23dbb27d11e56cf6586d93b091c708fa111a7a2d /t/oo.t
downloadData-Compare-tarball-master.tar.gz
Diffstat (limited to 't/oo.t')
-rw-r--r--t/oo.t27
1 files changed, 27 insertions, 0 deletions
diff --git a/t/oo.t b/t/oo.t
new file mode 100644
index 0000000..f043d19
--- /dev/null
+++ b/t/oo.t
@@ -0,0 +1,27 @@
+# -*- Mode: Perl -*-
+
+BEGIN { unshift @INC, "lib", "../lib" }
+use strict;
+use Data::Compare;
+
+local $^W = 1;
+print "1..7\n";
+
+my $t = 1;
+
+my $a = { 'foo' => [ 'bar', 'baz' ] };
+my $b = { 'Foo' => [ 'bar', 'baz' ] };
+
+my $c = new Data::Compare ($a, $b);
+print !$c->Cmp ? "" : "not ", "ok ", $t++, "\n";
+print $c->Cmp($a, $a) ? "" : "not ", "ok ", $t++, "\n";
+print !$c->Cmp($a, $b) ? "" : "not ", "ok ", $t++, "\n";
+
+my $d = new Data::Compare;
+print $d->Cmp ? "" : "not ", "ok ", $t++, "\n";
+print $d->Cmp($a, $a) ? "" : "not ", "ok ", $t++, "\n";
+print !$d->Cmp($a, $b) ? "" : "not ", "ok ", $t++, "\n";
+
+my $e = new Data::Compare;
+
+print $d->Cmp ($d, $e) ? "" : "not ", "ok ", $t++, "\n";