This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
dounwind(): do a POPBLOCK for final cx frame.
[perl5.git] / t / op / filehandle.t
1 #!./perl
2
3 BEGIN {
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
10 plan 4;
11 use FileHandle;
12
13 my $str = "foo";
14 open my $fh, "<", \$str;
15 is <$fh>, "foo", "open fh to reference to string: got expected content";
16
17 eval {
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
23 is $@, '', "no errors after 'seek' or 'tell'";