1use Test::Base tests => 3;
2
3my $out = "Stuff\n";
4my $err = '';
5
6tie_output(*STDOUT, $out);
7tie_output(*STDERR, $err);
8
9warn "Keep out!\n";
10
11print "The eagle has landed\n";
12
13is $out, "Stuff\nThe eagle has landed\n";
14
15print "This bird had flown\n";
16
17is $out, "Stuff\nThe eagle has landed\nThis bird had flown\n";
18
19print STDERR "You 'lil rascal...\n";
20
21is $err, "Keep out!\nYou 'lil rascal...\n";
22