3 # Check miscellaneous tied-array interface methods
4 # EXTEND, CLEAR, DELETE, EXISTS
7 use lib '/home/mjd/src/perl/Tie-File2/lib';
15 print "ok $N\n"; $N++;
17 my $o = tie @a, 'Tie::File', $file;
18 print $o ? "ok $N\n" : "not ok $N\n";
23 check_contents("$/$/$/");
25 check_contents("$/$/$/$/");
27 check_contents("$/$/$/$/");
34 print !exists $a[0] ? "ok $N\n" : "not ok $N\n";
36 $a[0] = "I like pie.";
37 print exists $a[0] ? "ok $N\n" : "not ok $N\n";
39 print !exists $a[1] ? "ok $N\n" : "not ok $N\n";
41 $a[2] = "GIVE ME PIE";
42 print exists $a[0] ? "ok $N\n" : "not ok $N\n";
44 # exists $a[1] is not defined by this module under these circumstances
45 print exists $a[1] ? "ok $N\n" : "ok $N\n";
47 print exists $a[2] ? "ok $N\n" : "not ok $N\n";
52 check_contents("$/$/GIVE ME PIE$/");
54 check_contents("$/$/");
56 check_contents("$/$/");
67 { local $/; $a = <FH> }
68 $a = "" unless defined $a;
72 s{$/}{\\n}g for $a, $x;
73 print "not ok $N\n# expected <$x>, got <$a>\n";
76 print $o->_check_integrity($file, $ENV{INTEGRITY}) ? "ok $N\n" : "not ok $N\n";