📄 basic.t
字号:
BEGIN { if( $ENV{PERL_CORE} ) { @INC = '../lib'; chdir 't'; }}use IO::Zlib;sub ok{ my ($no, $ok) = @_ ; #++ $total ; #++ $totalBad unless $ok ; print "ok $no\n" if $ok ; print "not ok $no\n" unless $ok ;}$name="test.gz";print "1..17\n";$hello = <<EOM ;hello worldthis is a testEOMok(1, $file = IO::Zlib->new($name, "wb"));ok(2, $file->print($hello));ok(3, $file->opened());ok(4, $file->close());ok(5, !$file->opened());ok(6, $file = IO::Zlib->new());ok(7, $file->open($name, "rb"));ok(8, !$file->eof());ok(9, $file->read($uncomp, 1024) == length($hello));ok(10, $uncomp eq $hello);ok(11, $file->eof());ok(12, $file->opened());ok(13, $file->close());ok(14, !$file->opened());$file = IO::Zlib->new($name, "rb");ok(15, $file->read($uncomp, 1024, length($uncomp)) == length($hello));ok(16, $uncomp eq $hello . $hello);$file->close();unlink($name);ok(17, !defined(IO::Zlib->new($name, "rb")));
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -