~ubuntu-branches/ubuntu/hardy/libpod-simple-perl/hardy

« back to all changes in this revision

Viewing changes to t/sanity_tfh.t

  • Committer: Bazaar Package Importer
  • Author(s): Jay Bonci
  • Date: 2004-01-02 15:38:21 UTC
  • Revision ID: james.westby@ubuntu.com-20040102153821-ezu9yx6kwbygkaae
Tags: upstream-2.05
ImportĀ upstreamĀ versionĀ 2.05

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
 
 
2
use strict;
 
3
use Test;
 
4
BEGIN { plan tests => 8 };
 
5
 
 
6
use Pod::Simple::TiedOutFH;
 
7
ok 1;
 
8
 
 
9
print "# Sanity test of Perl and Pod::Simple::TiedOutFH\n";
 
10
 
 
11
{
 
12
  my $x = 'abc';
 
13
  my $out = Pod::Simple::TiedOutFH->handle_on($x);
 
14
  print $out "Puppies\n";
 
15
  print $out "rrrrr";
 
16
  print $out "uffuff!";
 
17
  ok $x, "abcPuppies\nrrrrruffuff!";
 
18
  undef $out;
 
19
  ok $x, "abcPuppies\nrrrrruffuff!";
 
20
}
 
21
 
 
22
# Now test that we can have two different strings.
 
23
{
 
24
  my $x1 = 'abc';
 
25
  my $x2 = 'xyz';
 
26
  my $out1 = Pod::Simple::TiedOutFH->handle_on($x1);
 
27
  my $out2 = Pod::Simple::TiedOutFH->handle_on($x2);
 
28
 
 
29
  print $out1 "Puppies\n";
 
30
  print $out2 "Kitties\n";
 
31
  print $out2 "mmmmm";
 
32
  print $out1 "rrrrr";
 
33
  print $out2 "iaooowwlllllllrrr!\n";
 
34
  print $out1 "uffuff!";
 
35
 
 
36
  ok $x1, "abcPuppies\nrrrrruffuff!",              "out1 test";
 
37
  ok $x2, "xyzKitties\nmmmmmiaooowwlllllllrrr!\n", "out2 test";
 
38
 
 
39
  undef $out1;
 
40
  undef $out2;
 
41
 
 
42
  ok $x1, "abcPuppies\nrrrrruffuff!",              "out1 test";
 
43
  ok $x2, "xyzKitties\nmmmmmiaooowwlllllllrrr!\n", "out2 test";
 
44
}
 
45
 
 
46
 
 
47
print "# Wrapping up... one for the road...\n";
 
48
ok 1;
 
49
print "# --- Done with ", __FILE__, " --- \n";
 
50
 
 
51