summaryrefslogtreecommitdiff
path: root/gnu/usr.bin/perl/lib/SelectSaver.t
blob: 3b58d709ab3aa34edeb8cbf9cb4e99a41b2be66b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!./perl

BEGIN {
    chdir 't' if -d 't';
    @INC = '../lib';
}

print "1..3\n";

use SelectSaver;

open(FOO, ">foo-$$") || die;

print "ok 1\n";
{
    my $saver = new SelectSaver(FOO);
    print "foo\n";
}

# Get data written to file
open(FOO, "foo-$$") || die;
chomp($foo = <FOO>);
close FOO;
unlink "foo-$$";

print "ok 2\n" if $foo eq "foo";

print "ok 3\n";