/[fuse.before_github]/perl-llin/test/getattr.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/getattr.t

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

revision 21 by dpavlin, Mon Jan 2 19:50:33 2006 UTC revision 123 by dpavlin, Wed Mar 19 19:40:20 2008 UTC
# Line 2  Line 2 
2  use test::helper qw($_real $_point);  use test::helper qw($_real $_point);
3  use Test::More;  use Test::More;
4  use Data::Dumper;  use Data::Dumper;
5  plan tests => 28;  plan tests => 203;
6  my ($a, $b) = ("$_real/wibble","$_point/wibble");  sub test_file {
7  `touch $b`;          my $size = shift;
8  is(-A "$a", -A "$b", '-A'); # 1          my ($a, $b) = ("$_real/wibble-$size","$_point/wibble-$size");
9  is(-B "$a", -B "$b", '-B'); # 2  #       diag "test $size Gb file";
10  is(-C "$a", -C "$b", '-C'); # 3          open(my $fh, '>', $a) || die "can't open $b: $!";
11  is(-M "$a", -M "$b", '-M'); # 4          seek($fh, $size * 1024 * 1024 * 1024, 0);
12  is(-O "$a", -O "$b", '-O'); # 5          print $fh ' ';
13  is(-R "$a", -R "$b", '-R'); # 6          close($fh);
14  is(-S "$a", -S "$b", '-S'); # 7  #       diag "size $b = ",-s $b, " $a = ", -s $a;
15  is(-T "$a", -T "$b", '-T'); # 8          is(-A "$a", -A "$b", '-A'); # 1
16  is(-W "$a", -W "$b", '-W'); # 9          is(-B "$a", -B "$b", '-B'); # 2
17  is(-X "$a", -X "$b", '-X'); # 10          is(-C "$a", -C "$b", '-C'); # 3
18  is(-b "$a", -b "$b", '-b'); # 11          is(-M "$a", -M "$b", '-M'); # 4
19  is(-c "$a", -c "$b", '-c'); # 12          is(-O "$a", -O "$b", '-O'); # 5
20  is(-d "$a", -d "$b", '-d'); # 13          is(-R "$a", -R "$b", '-R'); # 6
21  is(-e "$a", -e "$b", '-e'); # 14          is(-S "$a", -S "$b", '-S'); # 7
22  is(-f "$a", -f "$b", '-f'); # 15          is(-T "$a", -T "$b", '-T'); # 8
23  is(-g "$a", -g "$b", '-g'); # 16          is(-W "$a", -W "$b", '-W'); # 9
24  is(-k "$a", -k "$b", '-k'); # 17          is(-X "$a", -X "$b", '-X'); # 10
25  is(-l "$a", -l "$b", '-l'); # 18          is(-b "$a", -b "$b", '-b'); # 11
26  is(-o "$a", -o "$b", '-o'); # 19          is(-c "$a", -c "$b", '-c'); # 12
27  is(-p "$a", -p "$b", '-p'); # 20          is(-d "$a", -d "$b", '-d'); # 13
28  is(-r "$a", -r "$b", '-r'); # 21          is(-e "$a", -e "$b", '-e'); # 14
29  is(-s "$a", -s "$b", '-s'); # 22          is(-f "$a", -f "$b", '-f'); # 15
30  is(-t "$a", -t "$b", '-t'); # 23          is(-g "$a", -g "$b", '-g'); # 16
31  is(-u "$a", -u "$b", '-u'); # 24          is(-k "$a", -k "$b", '-k'); # 17
32  is(-w "$a", -w "$b", '-w'); # 25          is(-l "$a", -l "$b", '-l'); # 18
33  is(-x "$a", -x "$b", '-x'); # 26          is(-o "$a", -o "$b", '-o'); # 19
34  is(-z "$a", -z "$b", '-z'); # 27          is(-p "$a", -p "$b", '-p'); # 20
35  my (@astat, @bstat);          is(-r "$a", -r "$b", '-r'); # 21
36  @astat = stat("$a");          is(-s "$a", -s "$b", '-s'); # 22
37  @bstat = stat("$b");          is(-t "$a", -t "$b", '-t'); # 23
38  # dev, inode and blksize can legally change          is(-u "$a", -u "$b", '-u'); # 24
39  @astat = @astat[2..10,12];          is(-w "$a", -w "$b", '-w'); # 25
40  @bstat = @bstat[2..10,12];          is(-x "$a", -x "$b", '-x'); # 26
41  is(join(" ",@astat),join(" ",@bstat),"stat()");          is(-z "$a", -z "$b", '-z'); # 27
42  `rm -f $a`;          my (@astat, @bstat);
43            @astat = stat("$a");
44            @bstat = stat("$b");
45            # dev, inode and blksize can legally change
46            @astat = @astat[2..10,12];
47            @bstat = @bstat[2..10,12];
48            is(join(" ",@astat),join(" ",@bstat),"stat()");
49            ok( unlink($a), 'unlink' );
50    }
51    test_file( $_ ) foreach ( 1, 2, 4, 8, 16, 32, 64 );

Legend:
Removed from v.21  
changed lines
  Added in v.123

  ViewVC Help
Powered by ViewVC 1.1.26