File: 09_eq.t

package info (click to toggle)
libgraph-perl 1%3A0.96-2
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 1,316 kB
  • ctags: 938
  • sloc: perl: 6,094; sh: 8; makefile: 2
file content (40 lines) | stat: -rw-r--r-- 541 bytes parent folder | download | duplicates (6)
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));