Permalink
Browse files

Fix the bug of counting.

  • Loading branch information...
1 parent d8c4477 commit 178a2a6c5ccedf535feee9a8c661d1f8c43896e9 @hiratara committed Sep 27, 2012
Showing with 10 additions and 9 deletions.
  1. +1 −1 lib/Algorithm/Simpath.pm
  2. +9 −8 t/basic.t
View
@@ -53,7 +53,7 @@ sub has_one_route($$$) {
$has_route = 1;
next;
}
- return; # Mustn't contain unwanted routes
+ return if defined $node->{mate}->{$_}; # Mustn't contain unwanted routes
}
return $has_route;
}
View
@@ -10,15 +10,16 @@ sub count($); sub count($) {
$node->{count} //= count($node->{low}) + count($node->{high});
}
-my $zdd = solve(
- start => 'A',
- goal => 'C',
- edges => [[qw(A B)], [qw(C A)], [qw(D A)], [qw(B D)], [qw(B C)], [qw(C D)]],
-);
-is +(count $zdd), 5;
+{
+ my $zdd = solve(
+ start => 'A',
+ goal => 'C',
+ edges => [[qw(A B)], [qw(C A)], [qw(D A)], [qw(B D)], [qw(B C)], [qw(C D)]],
+ );
+ is +(count $zdd), 5;
+}
-TODO: {
- local $TODO = "FIXME: Can't count if patthes are ordered randomly.";
+{
my $zdd = solve(
start => 'A',
goal => 'C',

0 comments on commit 178a2a6

Please sign in to comment.