3 # Check FETCHSIZE and SETSIZE functions
4 # PUSH POP SHIFT UNSHIFT
10 my $data = "rec0blahrec1blahrec2blah";
17 print "ok $N\n"; $N++;
19 # 2-3 FETCHSIZE 0-length file
20 open F, "> $file" or die $!;
22 $o = tie @a, 'Tie::File', $file, recsep => 'blah';
23 print $o ? "ok $N\n" : "not ok $N\n";
26 print $n == 0 ? "ok $N\n" : "not ok $N # $n, s/b 0\n";
33 # 4-5 FETCHSIZE positive-length file
34 open F, "> $file" or die $!;
37 $o = tie @a, 'Tie::File', $file, recsep => 'blah';
38 print $o ? "ok $N\n" : "not ok $N\n";
41 print $n == 3 ? "ok $N\n" : "not ok $N # $n, s/b 0\n";
47 check_contents("${data}blahblah");
49 # 7 Make it longer again:
51 check_contents("${data}blahblahblahblah");
55 check_contents("${data}blahblah");
57 # 9 Make it shorter again:
59 check_contents($data);
61 # 10 Get rid of it completely:
71 { local $/; $a = <FH> }
72 $a = "" unless defined $a;
76 ctrlfix(my $msg = "# expected <$x>, got <$a>");
77 print "not ok $N\n$msg\n";