AnyEvent-Impl-Prima

 view release on metacpan or  search on metacpan

t/02-prima-timer.t  view on Meta::CPAN

#!perl -w
use Test::More tests => 1;
BEGIN {
if( $^O !~ /mswin|darwin/i ) {
    if( ! $ENV{DISPLAY} ) {
        SKIP: {
            skip "Need a display for the tests", 1;
        };
        exit;
    };
};
}

use Prima;
use AnyEvent;
use Prima::Application;
use AnyEvent::Impl::Prima;

my $mw = Prima::MainWindow->new();

my $done;
my $t = AnyEvent->timer(
    cb => sub { $done++; $mw->close },
    after => 1,
);

Prima->run;

ok $done, "A timer catches us and we exit";

done_testing;



( run in 1.035 second using v1.01-cache-2.11-cpan-39bf76dae61 )