1 # This is -*-Perl-*- code#
2 # Bioperl Test Harness Script for Modules#
8 test_begin(-tests => 21,
9 -requires_module => 'Graph');
11 use_ok('Graph::Undirected');
12 use_ok('Graph::Traversal::DFS');
18 # The purpose of these tests is to check to see if bugs have been
19 # fixed in Perl's Graph, particularly if refvertexed == 1
21 my $g = Graph::Undirected->new(refvertexed => 1);
25 my $seq1 = Bio::Seq->new(-seq => "aaaaaaa");
26 my $seq2 = Bio::Seq->new(-seq => "ttttttt");
27 my $seq3 = Bio::Seq->new(-seq => "ccccccc");
28 my $seq4 = Bio::Seq->new(-seq => "ggggggg");
30 $g->add_vertices($seq1,$seq2,$seq3,$seq4);
31 $g->add_edges([$seq1,$seq2],[$seq3,$seq4],[$seq3,$seq2]);
33 my @vs = $g->vertices;
40 my $comp = $g->complement;
41 @vs = $comp->vertices;
44 @vs = $g->interior_vertices;
47 my $apsp = $g->APSP_Floyd_Warshall;
48 @vs = $apsp->path_vertices($seq1,$seq4);
51 my $seq = $g->random_vertex;
54 my $t = Graph::Traversal::DFS->new($g);
62 @vs = $g->articulation_points;
63 ok $vs[0]->seq; # not OK in Graph v. .80
66 my @cc = $g->connected_components;
76 my $cg = $g->connected_graph;
78 # ok $vs[0]->seq; incorrect usage
80 my @spd = $g->SP_Dijkstra($seq1,$seq4);
82 my @spbf = $g->SP_Bellman_Ford($seq1,$seq4);