Skip to content
Browse files

test is_done in file iterator

  • Loading branch information...
1 parent 1010a3e commit cb72d71bd0eda4e389da6349dbde61c55dd1dfc1 @nothingmuch nothingmuch committed
Showing with 9 additions and 1 deletion.
  1. +1 −1 lib/Data/Stream/Bulk/Path/Class.pm
  2. +8 −0 t/path_class.t
View
2 lib/Data/Stream/Bulk/Path/Class.pm
@@ -51,7 +51,7 @@ has _queue => (
sub is_done {
my $self = shift;
return (
- @{ $self->_dh_queue } == 0
+ @{ $self->_stack } == 0
and
@{ $self->_queue } == 0
);
View
8 t/path_class.t
@@ -26,8 +26,12 @@ foreach my $dir ( $dist->subdir("t"), $dist->subdir("lib"), $dist ) {
my @rec;
$dir->recurse( callback => sub { push @rec, "$_[0]" unless $_[0] =~ /tmp/ }, depthfirst => 0, preorder => 1 );
+ ok( !$_->is_done, "not done" ) for $paths, $strings;
+
my @all = $strings->all;
+ ok( $_->is_done, "done" ) for $paths, $strings;
+
is_deeply(
[ sort @all ],
[ sort @rec ],
@@ -54,8 +58,12 @@ foreach my $dir ( $dist->subdir("t"), $dist->subdir("lib"), $dist ) {
my @rec;
$dir->recurse( callback => sub { push @rec, "$_[0]" unless $_[0] =~ /tmp/ }, depthfirst => 1, preorder => 1 );
+ ok( !$_->is_done, "not done" ) for $paths, $strings;
+
my @all = $strings->all;
+ ok( $_->is_done, "done" ) for $paths, $strings;
+
is_deeply(
[ sort @all ],
[ sort @rec ],

0 comments on commit cb72d71

Please sign in to comment.
Something went wrong with that request. Please try again.