From 28ca1e85299aa99e243d27f62d18be3fbfc47d64 Mon Sep 17 00:00:00 2001 From: Michael Stapelberg Date: Thu, 5 Oct 2017 13:03:33 -0700 Subject: [PATCH] Fix AnyEvent->timer call (#3008) And make the remaining AnyEvent->condvar and AnyEvent->timer calls consistent. --- testcases/t/268-ipc-config.t | 4 ++-- testcases/t/289-ipc-shutdown-event.t | 4 ++-- testcases/t/525-i3bar-mouse-bindings.t | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/testcases/t/268-ipc-config.t b/testcases/t/268-ipc-config.t index b21ff1b2..9ac749b6 100644 --- a/testcases/t/268-ipc-config.t +++ b/testcases/t/268-ipc-config.t @@ -42,8 +42,8 @@ get_socket_path(0); my $i3 = i3(get_socket_path()); $i3->connect->recv; -my $cv = AE::cv; -my $timer = AE::timer 0.5, 0, sub { $cv->send(0); }; +my $cv = AnyEvent->condvar; +my $timer = AnyEvent->timer(after => 0.5, interval => 0, cb => sub { $cv->send(0); }); my $last_config = $i3->get_config()->recv; chomp($last_config->{config}); diff --git a/testcases/t/289-ipc-shutdown-event.t b/testcases/t/289-ipc-shutdown-event.t index f2b52460..606474e2 100644 --- a/testcases/t/289-ipc-shutdown-event.t +++ b/testcases/t/289-ipc-shutdown-event.t @@ -30,7 +30,7 @@ my $i3 = i3(get_socket_path()); $i3->connect->recv; my $cv = AnyEvent->condvar; -my $timer = AE::timer 0.5, 0, sub { $cv->send(0); }; +my $timer = AnyEvent->timer(after => 0.5, interval => 0, cb => sub { $cv->send(0); }); $i3->subscribe({ shutdown => sub { @@ -51,7 +51,7 @@ $i3 = i3(get_socket_path()); $i3->connect->recv; $cv = AnyEvent->condvar; -$timer = AE::timer 0.5, 0, sub { $cv->send(0); }; +$timer = AnyEvent->timer(after => 0.5, interval => 0, cb => sub { $cv->send(0); }); $i3->subscribe({ shutdown => sub { diff --git a/testcases/t/525-i3bar-mouse-bindings.t b/testcases/t/525-i3bar-mouse-bindings.t index d3216d97..e67f0df9 100644 --- a/testcases/t/525-i3bar-mouse-bindings.t +++ b/testcases/t/525-i3bar-mouse-bindings.t @@ -39,7 +39,7 @@ $i3->connect()->recv; my $ws = fresh_workspace; my $cv = AnyEvent->condvar; -my $timer = AnyEvent->timer(1, 0, sub { $cv->send(0) }); +my $timer = AnyEvent->timer(after => 1, interval => 0, cb => sub { $cv->send(0) }); $i3->subscribe({ window => sub { my ($event) = @_; -- 2.39.5