This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
t/op/filehandle.t: Provide descriptions for all tests.
[perl5.git] / t / op / filehandle.t
... / ...
CommitLineData
1#!./perl
2
3BEGIN {
4 chdir 't' if -d 't';
5 @INC = '../lib';
6 require './test.pl';
7 skip_all_if_miniperl("no dynamic loading on miniperl, no IO, hence no FileHandle");
8}
9
10plan 4;
11use FileHandle;
12
13my $str = "foo";
14open my $fh, "<", \$str;
15is <$fh>, "foo", "open fh to reference to string: got expected content";
16
17eval {
18 $fh->seek(0, 0);
19 is $fh->tell, 0, "after 'seek' and 'tell', got expected current fh position in bytes";
20 is <$fh>, "foo", "after 'seek' and 'tell', still got expected content";
21};
22
23is $@, '', "no errors after 'seek' or 'tell'";