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.1 by root, Tue Nov 27 07:27:10 2007 UTC vs.
Revision 1.5 by root, Thu Oct 21 15:13:42 2010 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 EV::unloop; 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";
24 EV::break;
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";
19 EV::unloop; 29 EV::break;
20}; 30};
21 31
22print "ok 1\n"; 32print $w->stat ? "" : "not ", "ok 1\n";
23EV::loop; 33EV::run;
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 :(
37undef $fh;
27 38
28my $t = EV::timer 0.2, 0, sub { 39my $t = EV::timer 0.2, 0, sub {
29 print "no ok 5\n"; 40 print "no ok 5\n";
30 EV::unloop; 41 EV::break;
31}; 42};
32 43
33print "ok 4\n"; 44print "ok 4\n";
34EV::loop; 45EV::run;
35print "ok 6\n"; 46print "ok 14\n";
36 47

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines