File: u_bb_rv.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 (44 lines) | stat: -rw-r--r-- 783 bytes parent folder | download | duplicates (9)
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
41
42
43
44
use Test::More tests => 11;

use strict;
use warnings;

use Graph;

my ($u, $v);

my $g1 = Graph->new(refvertexed => 1);
use Math::Complex qw(cplx);
$g1->add_edge($u = cplx(1,2), $v = cplx(3,4));
is($g1, "$u-$v");
$g1->delete_vertex($u);
is($g1, $v);
$g1->delete_vertex($v);
is($g1, "");

my $g2 = Graph->new(refvertexed => 1);
use Math::Complex qw(cplx);
$g2->add_vertex($u = cplx(1,2));
is($g2, $u);
$g2->add_vertex($v = cplx(3,4));
is($g2, "$u,$v");
$g2->delete_vertex($u);
is($g2, $v);
$g2->delete_vertex($v);
is($g2, "");

my $g3 = Graph->new(refvertexed => 1);
use Math::Complex qw(cplx);
$g3->add_edge($u = cplx(1,2), $v = cplx(3,4));
is($g3, "$u-$v");
$g3->delete_edge($u, $v);
is($g3, "$u,$v");
$g3->delete_vertex($u);
is($g3, $v);
$g3->delete_vertex($v);
is($g3, "");