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
d963bf01
NC
1#!./perl
2
d963bf01
NC
3BEGIN {
4 chdir 't' if -d 't';
5 @INC = '../lib';
6 require './test.pl';
c82d0e1e 7 skip_all_if_miniperl("no dynamic loading on miniperl, no IO, hence no FileHandle");
d963bf01
NC
8}
9
10plan 4;
11use FileHandle;
12
13my $str = "foo";
14open my $fh, "<", \$str;
462fadc1 15is <$fh>, "foo", "open fh to reference to string: got expected content";
d963bf01
NC
16
17eval {
18 $fh->seek(0, 0);
462fadc1
JK
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";
d963bf01
NC
21};
22
462fadc1 23is $@, '', "no errors after 'seek' or 'tell'";