This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Update Scalar-List-Utils to CPAN version 1.26
[perl5.git] / cpan / IO-Zlib / t / getc.t
1 use IO::Zlib;
2
3 sub ok
4 {
5     my ($no, $ok) = @_ ;
6
7     #++ $total ;
8     #++ $totalBad unless $ok ;
9
10     print "ok $no\n" if $ok ;
11     print "not ok $no\n" unless $ok ;
12 }
13
14 $name="test.gz";
15
16 print "1..10\n";
17
18 $text = "abcd";
19
20 ok(1, $file = IO::Zlib->new($name, "wb"));
21 ok(2, $file->print($text));
22 ok(3, $file->close());
23
24 ok(4, $file = IO::Zlib->new($name, "rb"));
25 ok(5, $file->getc() eq substr($text,0,1));
26 ok(6, $file->getc() eq substr($text,1,1));
27 ok(7, $file->getc() eq substr($text,2,1));
28 ok(8, $file->getc() eq substr($text,3,1));
29 ok(9, $file->getc() eq "");
30 ok(10, $file->close());
31
32 unlink($name);