/[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

Contents of /perl-llin/test/getattr.t

Parent Directory Parent Directory | Revision Log Revision Log


Revision 123 - (show annotations)
Wed Mar 19 19:40:20 2008 UTC (16 years ago) by dpavlin
File MIME type: application/x-troff
File size: 1608 byte(s)
another try to fix files larger than 2Gb: for this we pop
float from stack since long is limited to 4Gb
1 #!/usr/bin/perl
2 use test::helper qw($_real $_point);
3 use Test::More;
4 use Data::Dumper;
5 plan tests => 203;
6 sub test_file {
7 my $size = shift;
8 my ($a, $b) = ("$_real/wibble-$size","$_point/wibble-$size");
9 # diag "test $size Gb file";
10 open(my $fh, '>', $a) || die "can't open $b: $!";
11 seek($fh, $size * 1024 * 1024 * 1024, 0);
12 print $fh ' ';
13 close($fh);
14 # diag "size $b = ",-s $b, " $a = ", -s $a;
15 is(-A "$a", -A "$b", '-A'); # 1
16 is(-B "$a", -B "$b", '-B'); # 2
17 is(-C "$a", -C "$b", '-C'); # 3
18 is(-M "$a", -M "$b", '-M'); # 4
19 is(-O "$a", -O "$b", '-O'); # 5
20 is(-R "$a", -R "$b", '-R'); # 6
21 is(-S "$a", -S "$b", '-S'); # 7
22 is(-T "$a", -T "$b", '-T'); # 8
23 is(-W "$a", -W "$b", '-W'); # 9
24 is(-X "$a", -X "$b", '-X'); # 10
25 is(-b "$a", -b "$b", '-b'); # 11
26 is(-c "$a", -c "$b", '-c'); # 12
27 is(-d "$a", -d "$b", '-d'); # 13
28 is(-e "$a", -e "$b", '-e'); # 14
29 is(-f "$a", -f "$b", '-f'); # 15
30 is(-g "$a", -g "$b", '-g'); # 16
31 is(-k "$a", -k "$b", '-k'); # 17
32 is(-l "$a", -l "$b", '-l'); # 18
33 is(-o "$a", -o "$b", '-o'); # 19
34 is(-p "$a", -p "$b", '-p'); # 20
35 is(-r "$a", -r "$b", '-r'); # 21
36 is(-s "$a", -s "$b", '-s'); # 22
37 is(-t "$a", -t "$b", '-t'); # 23
38 is(-u "$a", -u "$b", '-u'); # 24
39 is(-w "$a", -w "$b", '-w'); # 25
40 is(-x "$a", -x "$b", '-x'); # 26
41 is(-z "$a", -z "$b", '-z'); # 27
42 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 );

  ViewVC Help
Powered by ViewVC 1.1.26