/[fuse.before_github]/perl-llin/test/chown.t
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /perl-llin/test/chown.t

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 9 by mszeredi, Thu Nov 11 14:44:15 2004 UTC revision 10 by dpavlin, Sun Mar 20 00:36:05 2005 UTC
# Line 1  Line 1 
1  #!/usr/bin/perl  #!/usr/bin/perl
2  use test::helper qw($_real $_point);  use test::helper qw($_real $_point);
3  use Test::More;  use Test::More;
4    use English;
5  plan tests => 4;  plan tests => 4;
6    
7  my (@stat);  my (@stat);
8  chdir($_point);  chdir($_point);
9  system("echo frog >file");  system("echo frog >file");
10  ok(chown(0,0,"file"),"set 0,0");  
11  @stat = stat("file");  SKIP: {
12  ok($stat[4] == 0 && $stat[5] == 0,"0,0");          skip('Need root to give away ownership', 4) unless ($UID == 0);
13  ok(chown(1,1,"file"),"set 1,1");  
14  @stat = stat("file");          ok(chown(0,0,"file"),"set 0,0");
15  ok($stat[4] == 1 && $stat[5] == 1,"1,1");          @stat = stat("file");
16            ok($stat[4] == 0 && $stat[5] == 0,"0,0");
17            ok(chown(1,1,"file"),"set 1,1");
18            @stat = stat("file");
19            ok($stat[4] == 1 && $stat[5] == 1,"1,1");
20    }
21    
22  unlink("file");  unlink("file");

Legend:
Removed from v.9  
changed lines
  Added in v.10

  ViewVC Help
Powered by ViewVC 1.1.26