ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/EV/t/04_stat.t
(Generate patch)

Comparing EV/t/04_stat.t (file contents):
Revision 1.2 by root, Tue Nov 27 09:37:59 2007 UTC vs.
Revision 1.3 by root, Wed Nov 28 17:32:24 2007 UTC

1BEGIN { $| = 1; print "1..6\n"; } 1BEGIN { $| = 1; print "1..14\n"; }
2 2
3no warnings; 3no warnings;
4use strict; 4use strict;
5 5
6use File::Temp; 6use File::Temp;
9 9
10my $fh = new File::Temp UNLINK => 1; 10my $fh = new File::Temp UNLINK => 1;
11 11
12my $w = EV::stat "$fh", 0.1, sub { 12my $w = EV::stat "$fh", 0.1, sub {
13 print "ok 5\n"; 13 print "ok 5\n";
14 print 1 == $_[0]->prev ? "" : "not ", "ok 6\n";
15 print 13 == scalar (() = $_[0]->prev) ? "" : "not ", "ok 7\n";
16 print "0" eq -s _ ? "" : "not ", "ok 8\n";
17 print 1 == ($_[0]->prev)[3] ? "" : "not ", "ok 9\n";
18
19 print 0 == $_[0]->attr ? "" : "not ", "ok 10\n";
20 print 0 == ($_[0]->attr)[3] ? "" : "not ", "ok 11\n";
21
22 print 0 == $_[0]->stat ? "" : "not ", "ok 12\n";
23 print 0 == ($_[0]->stat)[3] ? "" : "not ", "ok 13\n";
14 EV::unloop; 24 EV::unloop;
15}; 25};
16 26
17my $t = EV::timer 0.2, 0, sub { 27my $t = EV::timer 0.2, 0, sub {
18 print "ok 2\n"; 28 print "ok 2\n";
21 31
22print "ok 1\n"; 32print "ok 1\n";
23EV::loop; 33EV::loop;
24print "ok 3\n"; 34print "ok 3\n";
25 35
26syswrite $fh, "size change"; 36# delete the file, as windows will not update any stats otherwise :(
27undef $fh; # work around bugs in windows not updating stat info 37undef $fh;
28 38
29my $t = EV::timer 0.2, 0, sub { 39my $t = EV::timer 0.2, 0, sub {
30 print "no ok 5\n"; 40 print "no ok 5\n";
31 EV::unloop; 41 EV::unloop;
32}; 42};
33 43
34print "ok 4\n"; 44print "ok 4\n";
35EV::loop; 45EV::loop;
36print "ok 6\n"; 46print "ok 14\n";
37 47

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines