ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/Linux-Inotify2/t/01_inotify.t
Revision: 1.1
Committed: Mon Dec 19 16:50:27 2005 UTC (20 years, 9 months ago) by root
Content type: application/x-troff
Branch: MAIN
CVS Tags: rel-1_0
Log Message:
*** empty log message ***

File Contents

# User Rev Content
1 root 1.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     use PApp::Util;
25     warn PApp::Util::dumpval \@list;
26     ok (@list > 0, scalar @list . " events read");
27     }
28    
29     ok ($watch->cancel, "watch canceled");
30    
31     END {
32     rmdir $$;
33     }
34