File: 35_uniqvertexed.t

package info (click to toggle)
libgraph-perl 1%3A0.91-1
  • links: PTS
  • area: main
  • in suites: squeeze, wheezy
  • size: 1,152 kB
  • ctags: 590
  • sloc: perl: 6,065; makefile: 37; sh: 8
file content (25 lines) | stat: -rw-r--r-- 487 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
use Test::More tests => 10;

use Graph;

my $g0 = Graph->new(hypervertexed => 1, uniqvertexed => 1);

ok($g0->uniqvertexed);

ok($g0->add_vertex('a', 'a'));

ok($g0->has_vertex('a'));
ok($g0->has_vertex('a', 'a'));
ok($g0->has_vertex('a', 'a', 'a'));

my $g1 = Graph->new(hypervertexed => 1, uniqvertexed => 0);

ok(!$g1->uniqvertexed);

ok($g1->add_vertex('a', 'a'));

ok( $g1->has_vertex('a')); # Added implicitly
ok( $g1->has_vertex('a', 'a'));
ok(!$g1->has_vertex('a', 'a', 'a'));