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 28 29 30 31 32 33 34 35 36 37 38 39 40
|
use Test::More tests => 14;
use Graph;
my $g = Graph->new;
$g->add_vertices(qw(a b c d));
$g->add_path(qw(b c e f));
my $h = Graph->new;
$h->add_vertices(qw(a b c d));
$h->add_path(qw(b c e f));
my $i = $h->new;
$i->add_vertex(qw(g));
is($g, "b-c,c-e,e-f,a,d");
is("b-c,c-e,e-f,a,d", $g);
ok($g->eq("b-c,c-e,e-f,a,d"));
is($g, $h);
is($h, $g);
ok($g->eq($h));
ok($h->eq($g));
isnt($i, "b-c,c-e,e-f,a,d");
isnt("b-c,c-e,e-f,a,d", $i);
ok($i->ne("b-c,c-e,e-f,a,d"));
isnt($g, $i);
isnt($i, $g);
ok($g->ne($i));
ok($i->ne($g));
|