⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 002any-transparent.t

📁 source of perl for linux application,
💻 T
字号:
BEGIN {    if ($ENV{PERL_CORE}) {        chdir 't' if -d 't';        @INC = ("../lib", "lib/compress");    }}use lib qw(t t/compress); use strict;use warnings;use bytes;use Test::More ;use CompTestUtils;BEGIN {    # use Test::NoWarnings, if available    my $extra = 0 ;    $extra = 1        if eval { require Test::NoWarnings ;  import Test::NoWarnings; 1 };    plan tests => 15 + $extra ;    use_ok('IO::Uncompress::AnyInflate', qw($AnyInflateError)) ;}{    my $string = <<EOM;This is not compressed dataEOM    my $buffer = $string ;    for my $file (0, 1)    {        title "AnyInflate with Non-compressed data (File $file)" ;        my $lex = new LexFile my $output;        my $input ;        if ($file) {            writeFile($output, $buffer);            $input = $output;        }        else {            $input = \$buffer;        }        my $unc ;        my $keep = $buffer ;        $unc = new IO::Uncompress::AnyInflate $input, -Transparent => 0 ;        ok ! $unc,"  no AnyInflate object when -Transparent => 0" ;        is $buffer, $keep ;        $buffer = $keep ;        $unc = new IO::Uncompress::AnyInflate \$buffer, -Transparent => 1 ;        ok $unc, "  AnyInflate object when -Transparent => 1"  ;        my $uncomp ;        ok $unc->read($uncomp) > 0 ;        ok $unc->eof() ;        #ok $unc->type eq $Type;        is $uncomp, $string ;    }}1;

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -