This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Carp: Don’t choke on ISA constant
[perl5.git] / lib / SelectSaver.t
CommitLineData
1a3850a5
GA
1#!./perl
2
3BEGIN {
4 chdir 't' if -d 't';
20822f61 5 @INC = '../lib';
1a3850a5
GA
6}
7
8print "1..3\n";
9
10use SelectSaver;
11
1ae6ead9 12open(FOO, ">", "foo-$$") || die;
1a3850a5
GA
13
14print "ok 1\n";
15{
16 my $saver = new SelectSaver(FOO);
17 print "foo\n";
18}
19
20# Get data written to file
1ae6ead9 21open(FOO, "<", "foo-$$") || die;
1a3850a5
GA
22chomp($foo = <FOO>);
23close FOO;
24unlink "foo-$$";
25
26print "ok 2\n" if $foo eq "foo";
27
28print "ok 3\n";