]> git.sur5r.net Git - i3/i3/blobdiff - testcases/t/289-ipc-shutdown-event.t
Implement the tick event
[i3/i3] / testcases / t / 289-ipc-shutdown-event.t
index 0cf347aa88b923c210f0c551308ec05e67c3edbb..f2b5246010054fcc6a0825918bd52007229c035e 100644 (file)
 # Bug still in: 4.12-46-g2123888
 use i3test;
 
-SKIP: {
-    skip "AnyEvent::I3 too old (need >= 0.17)", 1 if $AnyEvent::I3::VERSION < 0.17;
+# We cannot use events_for in this test as we cannot send events after
+# issuing the restart/shutdown command.
 
 my $i3 = i3(get_socket_path());
 $i3->connect->recv;
 
-my $cv = AE::cv;
+my $cv = AnyEvent->condvar;
 my $timer = AE::timer 0.5, 0, sub { $cv->send(0); };
 
 $i3->subscribe({
@@ -50,7 +50,7 @@ is($e->{change}, 'restart', 'the `change` field should tell the reason for the s
 $i3 = i3(get_socket_path());
 $i3->connect->recv;
 
-$cv = AE::cv;
+$cv = AnyEvent->condvar;
 $timer = AE::timer 0.5, 0, sub { $cv->send(0); };
 
 $i3->subscribe({
@@ -66,6 +66,5 @@ $e = $cv->recv;
 diag "Event:\n", Dumper($e);
 ok($e, 'the shutdown event should emit when the ipc is exited by command');
 is($e->{change}, 'exit', 'the `change` field should tell the reason for the shutdown');
-}
 
 done_testing;