3 # Check FETCHSIZE and SETSIZE functions
4 # PUSH POP SHIFT UNSHIFT
8 my $data = "rec0$/rec1$/rec2$/";
15 print "ok $N\n"; $N++;
17 # 2-3 FETCHSIZE 0-length file
18 open F, "> $file" or die $!;
20 $o = tie @a, 'Tie::File', $file;
21 print $o ? "ok $N\n" : "not ok $N\n";
24 print $n == 0 ? "ok $N\n" : "not ok $N # $n, s/b 0\n";
31 # 4-5 FETCHSIZE positive-length file
32 open F, "> $file" or die $!;
35 $o = tie @a, 'Tie::File', $file;
36 print $o ? "ok $N\n" : "not ok $N\n";
39 print $n == 3 ? "ok $N\n" : "not ok $N # $n, s/b 0\n";
45 check_contents("$data$/$/");
47 # 7 Make it longer again:
49 check_contents("$data$/$/$/$/");
53 check_contents("$data$/$/");
55 # 9 Make it shorter again:
57 check_contents($data);
59 # 10 Get rid of it completely:
67 my $open = open FH, "< $file";
69 { local $/; $a = <FH> }
70 print (($open && $a eq $x) ? "ok $N\n" : "not ok $N\n");