Commit | Line | Data |
---|---|---|
d963bf01 NC |
1 | #!./perl |
2 | ||
d963bf01 NC |
3 | BEGIN { |
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 | ||
10 | plan 4; | |
11 | use FileHandle; | |
12 | ||
13 | my $str = "foo"; | |
14 | open my $fh, "<", \$str; | |
462fadc1 | 15 | is <$fh>, "foo", "open fh to reference to string: got expected content"; |
d963bf01 NC |
16 | |
17 | eval { | |
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 | 23 | is $@, '', "no errors after 'seek' or 'tell'"; |