Commit | Line | Data |
---|---|---|
72e93046 JH |
1 | #!./perl |
2 | ||
72e93046 JH |
3 | BEGIN { |
4 | chdir 't' if -d 't'; | |
5 | @INC = '../lib'; | |
0214bff6 | 6 | require './test.pl'; |
e05e9c3d | 7 | skip_all_without_perlio(); |
273be65c | 8 | skip_all_without_dynamic_extension('Fcntl'); # how did you get this far? |
72e93046 JH |
9 | } |
10 | ||
3484683b RGS |
11 | use strict; |
12 | use warnings; | |
13 | ||
0214bff6 | 14 | plan tests => 6; |
72e93046 JH |
15 | |
16 | use Fcntl qw(:seek); | |
17 | ||
18 | { | |
19 | ok((open my $fh, "+>", undef), "open my \$fh, '+>', undef"); | |
20 | print $fh "the right write stuff"; | |
21 | ok(seek($fh, 0, SEEK_SET), "seek to zero"); | |
22 | my $data = <$fh>; | |
23 | is($data, "the right write stuff", "found the right stuff"); | |
24 | } | |
25 | ||
26 | { | |
27 | ok((open my $fh, "+<", undef), "open my \$fh, '+<', undef"); | |
28 | print $fh "the right read stuff"; | |
29 | ok(seek($fh, 0, SEEK_SET), "seek to zero"); | |
30 | my $data = <$fh>; | |
31 | is($data, "the right read stuff", "found the right stuff"); | |
32 | } | |
33 | ||
34 | ||
35 | ||
36 |