ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/Linux-Inotify2/t/01_inotify.t
Revision: 1.2
Committed: Tue Dec 20 11:33:03 2005 UTC (20 years, 8 months ago) by root
Content type: application/x-troff
Branch: MAIN
CVS Tags: rel-1_1, rel-1_2, rel-2_2, rel-2_3, rel-2_0, rel-2_1, rel-1_01, rel-1_21, rel-1_22, HEAD
Changes since 1.1: +0 -2 lines
Error occurred while calculating annotation data.
Log Message:
*** empty log message ***

File Contents

# Content
1 use Test::Simple tests => 5;
2 use Linux::Inotify2;
3
4 my $in = Linux::Inotify2->new;
5 ok ($in, "inotify handle created");
6
7 # create directory for watch
8 mkdir $$;
9
10 my $watch = $in->watch ($$, IN_ALL_EVENTS);
11 ok ($watch, "watch created for directory $$");
12
13 $in->blocking (0);
14
15 {
16 my @list = $in->read;
17 ok (@list==0, "non blocking: $!");
18 }
19
20 rmdir $$;
21
22 {
23 my @list = $in->poll;
24 ok (@list > 0, scalar @list . " events read");
25 }
26
27 ok ($watch->cancel, "watch canceled");
28
29 END {
30 rmdir $$;
31 }
32