]> Sergey Matveev's repositories - public-inbox.git/blobdiff - t/dir_idle.t
No ext_urls
[public-inbox.git] / t / dir_idle.t
index 0bb3b7585328dc2308c315019b80320c53e4508c..19e54967bf8066af57f5cddb5d8c24936a8277fa 100644 (file)
@@ -9,13 +9,14 @@ my ($tmpdir, $for_destroy) = tmpdir();
 make_path("$tmpdir/a/b", "$tmpdir/c");
 my @x;
 my $cb = sub { push @x, \@_ };
-my $di = PublicInbox::DirIdle->new(["$tmpdir/a", "$tmpdir/c"], $cb, 1);
+my $di = PublicInbox::DirIdle->new($cb);
+$di->add_watches(["$tmpdir/a", "$tmpdir/c"], 1);
 PublicInbox::DS->SetLoopTimeout(1000);
 my $end = 3 + now;
 PublicInbox::DS->SetPostLoopCallback(sub { scalar(@x) == 0 && now < $end });
 tick(0.011);
 rmdir("$tmpdir/a/b") or xbail "rmdir $!";
-PublicInbox::DS->EventLoop;
+PublicInbox::DS::event_loop();
 is(scalar(@x), 1, 'got an event') and
        is($x[0]->[0]->fullname, "$tmpdir/a/b", 'got expected fullname') and
        ok($x[0]->[0]->IN_DELETE, 'IN_DELETE set');
@@ -24,7 +25,7 @@ tick(0.011);
 rmdir("$tmpdir/a") or xbail "rmdir $!";
 @x = ();
 $end = 3 + now;
-PublicInbox::DS->EventLoop;
+PublicInbox::DS::event_loop();
 is(scalar(@x), 1, 'got an event') and
        is($x[0]->[0]->fullname, "$tmpdir/a", 'got expected fullname') and
        ok($x[0]->[0]->IN_DELETE_SELF, 'IN_DELETE_SELF set');
@@ -33,7 +34,7 @@ tick(0.011);
 rename("$tmpdir/c", "$tmpdir/j") or xbail "rmdir $!";
 @x = ();
 $end = 3 + now;
-PublicInbox::DS->EventLoop;
+PublicInbox::DS::event_loop();
 is(scalar(@x), 1, 'got an event') and
        is($x[0]->[0]->fullname, "$tmpdir/c", 'got expected fullname') and
        ok($x[0]->[0]->IN_DELETE_SELF || $x[0]->[0]->IN_MOVE_SELF,