Algorithm-Graphs-TransitiveClosure

 view release on metacpan or  search on metacpan

t/000_tests.t  view on Meta::CPAN

28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
        "@{$graph->[1]}" eq '1 1 1 1' and
        "@{$graph->[2]}" eq '1 1 1 1' and
        "@{$graph->[3]}" eq '1 1 1 1') {
        print "ok ", $test_num ++, "\n";
    }
    else {
        print "not ok ", $test_num ++, "\n";
    }
};
 
if ($@) {print "... error: $@\n";}
 
eval {
    my $graph = {
        one   => {one => 1},
        two   => {two => 1, three => 1, four => 1},
        three => {two => 1, three => 1},
        four  => {one => 1, three => 1, four => 1},
    };
    floyd_warshall $graph;
    if (1 == keys %{$graph -> {one}}   && $graph -> {one}   -> {one}   == 1 &&

t/000_tests.t  view on Meta::CPAN

58
59
60
61
62
63
64
65
66
67
68
                                          $graph -> {four}  -> {two}   == 1 &&
                                          $graph -> {four}  -> {three} == 1 &&
                                          $graph -> {four}  -> {four}  == 1) {
        print "ok ", $test_num ++, "\n";
    }
    else {
        print "not ok ", $test_num ++, "\n";
    }
};
 
if ($@) {print "... error: $@\n";}



( run in 0.683 second using v1.01-cache-2.11-cpan-95122f20152 )