diff options
Diffstat (limited to 'cpan/Tie-File/t/03_longfetch.t')
-rw-r--r-- | cpan/Tie-File/t/03_longfetch.t | 54 |
1 files changed, 0 insertions, 54 deletions
diff --git a/cpan/Tie-File/t/03_longfetch.t b/cpan/Tie-File/t/03_longfetch.t deleted file mode 100644 index 7d5a3886fe..0000000000 --- a/cpan/Tie-File/t/03_longfetch.t +++ /dev/null @@ -1,54 +0,0 @@ -#!/usr/bin/perl -# -# Make sure we can fetch a record in the middle of the file -# before we've ever looked at any records before it -# -# Make sure fetching past the end of the file returns the undefined value -# -# (tests _fill_offsets_to() ) -# - -my $file = "tf$$.txt"; -$: = Tie::File::_default_recsep(); -my $data = "rec0$:rec1$:rec2$:"; - -print "1..8\n"; - -my $N = 1; -use Tie::File; -print "ok $N\n"; $N++; - -open F, "> $file" or die $!; -binmode F; -print F $data; -close F; - - -my $o = tie @a, 'Tie::File', $file, autochomp => 0; -print $o ? "ok $N\n" : "not ok $N\n"; -$N++; - -$: = $o->{recsep}; - -my $n; - -# 3-5 -for (2, 1, 0) { - my $rec = $a[$_]; - print $rec eq "rec$_$:" ? "ok $N\n" : "not ok $N # rec=<$rec> ?\n"; - $N++; -} - -# 6-8 -for (3, 4, 6) { - my $rec = $a[$_]; - print ((not defined $rec) ? "ok $N\n" : "not ok $N # rec=<$rec> is defined\n"); - $N++; -} - -END { - undef $o; - untie @a; - 1 while unlink $file; -} - |