~ubuntu-branches/ubuntu/natty/perl-tk/natty

« back to all changes in this revision

Viewing changes to t/after.t

  • Committer: Bazaar Package Importer
  • Author(s): Stephen Zander
  • Date: 2004-03-14 13:54:44 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20040314135444-prc09u2or4dbr3to
Tags: 1:800.025-2
Add xlibs-dev to Build-Depends:,
Closes: #237942

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
use Test::More (tests => 6);
 
2
use Tk;
 
3
my $mw = MainWindow->new;
 
4
$mw->withdraw;
 
5
my $start = time;
 
6
$mw->after(1000,sub { my $t = time;
 
7
                      isnt($t,$start);
 
8
                      ok( $t >= $start+1,"$t >= $start");
 
9
                      ok( $t <= $start+2 ) });
 
10
$mw->after(2000,sub { my $t = time;
 
11
                      ok( $t >= $start+2 );
 
12
                      ok( $t <= $start+3 ) });
 
13
$mw->after(3000,[destroy => $mw ]);
 
14
MainLoop;
 
15
ok(time >= $start+3);
 
16