File: oo.t

package info (click to toggle)
libdata-compare-perl 0.13-1
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 104 kB
  • ctags: 15
  • sloc: perl: 329; makefile: 43
file content (27 lines) | stat: -rw-r--r-- 690 bytes parent folder | download | duplicates (12)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
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";