ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/EV/t/04_stat.t
Revision: 1.3
Committed: Wed Nov 28 17:32:24 2007 UTC (16 years, 7 months ago) by root
Content type: application/x-troff
Branch: MAIN
Changes since 1.2: +14 -4 lines
Log Message:
fucking windows hates iso c, stupid microsoft lock-in strategy

File Contents

# Content
1 BEGIN { $| = 1; print "1..14\n"; }
2
3 no warnings;
4 use strict;
5
6 use File::Temp;
7
8 use EV;
9
10 my $fh = new File::Temp UNLINK => 1;
11
12 my $w = EV::stat "$fh", 0.1, sub {
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";
24 EV::unloop;
25 };
26
27 my $t = EV::timer 0.2, 0, sub {
28 print "ok 2\n";
29 EV::unloop;
30 };
31
32 print "ok 1\n";
33 EV::loop;
34 print "ok 3\n";
35
36 # delete the file, as windows will not update any stats otherwise :(
37 undef $fh;
38
39 my $t = EV::timer 0.2, 0, sub {
40 print "no ok 5\n";
41 EV::unloop;
42 };
43
44 print "ok 4\n";
45 EV::loop;
46 print "ok 14\n";
47