1 # Testing tied output filehandle
11 BEGIN { plan tests => 8 };
13 use Pod::Simple::TiedOutFH;
16 print "# Sanity test of Perl and Pod::Simple::TiedOutFH\n";
20 my $out = Pod::Simple::TiedOutFH->handle_on($x);
21 print $out "Puppies\n";
24 ok $x, "abcPuppies\nrrrrruffuff!";
26 ok $x, "abcPuppies\nrrrrruffuff!";
29 # Now test that we can have two different strings.
33 my $out1 = Pod::Simple::TiedOutFH->handle_on($x1);
34 my $out2 = Pod::Simple::TiedOutFH->handle_on($x2);
36 print $out1 "Puppies\n";
37 print $out2 "Kitties\n";
40 print $out2 "iaooowwlllllllrrr!\n";
41 print $out1 "uffuff!";
43 ok $x1, "abcPuppies\nrrrrruffuff!", "out1 test";
44 ok $x2, "xyzKitties\nmmmmmiaooowwlllllllrrr!\n", "out2 test";
49 ok $x1, "abcPuppies\nrrrrruffuff!", "out1 test";
50 ok $x2, "xyzKitties\nmmmmmiaooowwlllllllrrr!\n", "out2 test";
54 print "# Wrapping up... one for the road...\n";
56 print "# --- Done with ", __FILE__, " --- \n";