| 1 | BEGIN { |
| 2 | if ($ENVscip-perl cpan Compress-Raw-Lzma 2.224 main/`%ENV`.{PERL_CORE}) { |
| 3 | chdirscip-perl cpan Compress-Raw-Lzma 2.224 main/chdir(). 't' if -d 't'; |
| 4 | #@INC = ("../lib", "lib/compress"); |
| 5 | @INCscip-perl cpan Compress-Raw-Lzma 2.224 main/`@INC`. = ("../lib"); |
| 6 | } |
| 7 | } |
| 8 | |
| 9 | use libscip-perl cpan Compress-Raw-Lzma 2.224 lib/ 't'; |
| 10 | use strictscip-perl cpan Compress-Raw-Lzma 2.224 strict/; |
| 11 | use warningsscip-perl cpan Compress-Raw-Lzma 2.224 warnings/; |
| 12 | use bytesscip-perl cpan Compress-Raw-Lzma 2.224 bytes/; |
| 13 | |
| 14 | use Test::Morescip-perl cpan Compress-Raw-Lzma 2.224 Test/More/ ; |
| 15 | #use CompTestUtils; |
| 16 | |
| 17 | |
| 18 | BEGIN |
| 19 | { |
| 20 | # use Test::NoWarnings, if available |
| 21 | my $extra = 0 ; |
| 22 | $extra = 1 |
| 23 | if eval { requirescip-perl cpan Compress-Raw-Lzma 2.224 main/require(). Test::NoWarnings ; import Test::NoWarnings; 1 }; |
| 24 | |
| 25 | |
| 26 | my $count = 785 ; |
| 27 | |
| 28 | planscip-perl cpan Compress-Raw-Lzma 2.224 main/plan(). tests => $count + $extra; |
| 29 | |
| 30 | use_okscip-perl cpan Compress-Raw-Lzma 2.224 main/use_ok().('Compress::Raw::Lzma') ; |
| 31 | } |
| 32 | |
| 33 | sub titlescip-perl cpan Compress-Raw-Lzma 2.224 main/title(). |
| 34 | { |
| 35 | #diag "" ; |
| 36 | ok 1, $_scip-perl cpan Compress-Raw-Lzma 2.224 main/`@_`.[0] ; |
| 37 | #diag "" ; |
| 38 | } |
| 39 | |
| 40 | sub mkErrscip-perl cpan Compress-Raw-Lzma 2.224 main/mkErr(). |
| 41 | { |
| 42 | my $string = shiftscip-perl cpan Compress-Raw-Lzma 2.224 main/shift(). ; |
| 43 | my ($dummy, $file, $line) = callerscip-perl cpan Compress-Raw-Lzma 2.224 main/caller(). ; |
| 44 | -- $line ; |
| 45 | |
| 46 | $string = quotemetascip-perl cpan Compress-Raw-Lzma 2.224 main/quotemeta(). $string; |
| 47 | $file = quotemetascip-perl cpan Compress-Raw-Lzma 2.224 main/quotemeta().($file); |
| 48 | |
| 49 | #return "/$string\\s+at $file line $line/" if $] >= 5.006 ; |
| 50 | return "/$string\\s+at /" ; |
| 51 | } |
| 52 | |
| 53 | sub mkEvalErrscip-perl cpan Compress-Raw-Lzma 2.224 main/mkEvalErr(). |
| 54 | { |
| 55 | my $string = shiftscip-perl cpan Compress-Raw-Lzma 2.224 main/shift(). ; |
| 56 | |
| 57 | return "/$string\\s+at \\(eval /" if $]scip-perl cpan Compress-Raw-Lzma 2.224 main/`$]`. > 5.006 ; |
| 58 | return "/$string\\s+at /" ; |
| 59 | } |
| 60 | |
| 61 | |
| 62 | sub doitscip-perl cpan Compress-Raw-Lzma 2.224 main/doit(). |
| 63 | { |
| 64 | my $compress_class = shiftscip-perl cpan Compress-Raw-Lzma 2.224 main/shift().; |
| 65 | my $uncompress_class = shiftscip-perl cpan Compress-Raw-Lzma 2.224 main/shift().; |
| 66 | |
| 67 | titlescip-perl cpan Compress-Raw-Lzma 2.224 main/title(). "$compress_class and $uncompress_class"; |
| 68 | |
| 69 | my $hello = <<EOM ; |
| 70 | hello world |
| 71 | this is a test |
| 72 | EOM |
| 73 | |
| 74 | my $len = lengthscip-perl cpan Compress-Raw-Lzma 2.224 main/length(). $hello ; |
| 75 | |
| 76 | if (0) |
| 77 | { |
| 78 | titlescip-perl cpan Compress-Raw-Lzma 2.224 main/title(). "Error Cases" ; |
| 79 | |
| 80 | eval { $compress_class->newscip-perl cpan Compress-Raw-Lzma 2.224 main/new().(1,2,3,4,5,6) }; |
| 81 | likescip-perl cpan Compress-Raw-Lzma 2.224 main/like(). $@scip-perl cpan Compress-Raw-Lzma 2.224 main/`$@`., mkErrscip-perl cpan Compress-Raw-Lzma 2.224 main/mkErr(). "Usage: Compress::Raw::Lzma::lzma_alone_encoder(class, appendOut=1)"; |
| 82 | |
| 83 | } |
| 84 | |
| 85 | |
| 86 | if (1) |
| 87 | { |
| 88 | |
| 89 | titlescip-perl cpan Compress-Raw-Lzma 2.224 main/title(). "lzma - small buffer"; |
| 90 | # ============================== |
| 91 | |
| 92 | my $hello = "I am a HAL 9000 computer" ; |
| 93 | my @hello = splitscip-perl cpan Compress-Raw-Lzma 2.224 main/split().('', $hello) ; |
| 94 | my ($err, $x, $X, $status); |
| 95 | |
| 96 | ($x, $err) = $compress_class->newscip-perl cpan Compress-Raw-Lzma 2.224 main/new().(); |
| 97 | isa_okscip-perl cpan Compress-Raw-Lzma 2.224 main/isa_ok(). $x, "Compress::Raw::Lzma::Encoder"; |
| 98 | cmp_okscip-perl cpan Compress-Raw-Lzma 2.224 main/cmp_ok(). $err, '==', LZMA_OK, "status is LZMA_OK" ; |
| 99 | |
| 100 | isscip-perl cpan Compress-Raw-Lzma 2.224 main/is(). $x->uncompressedBytesscip-perl cpan Compress-Raw-Lzma 2.224 main/uncompressedBytes().(), 0, "uncompressedBytes() == 0" ; |
| 101 | isscip-perl cpan Compress-Raw-Lzma 2.224 main/is(). $x->compressedBytesscip-perl cpan Compress-Raw-Lzma 2.224 main/compressedBytes().(), 0, "compressedBytes() == 0" ; |
| 102 | |
| 103 | $X = "" ; |
| 104 | my $Answer = ''; |
| 105 | foreach (@hello) |
| 106 | { |
| 107 | $status = $x->codescip-perl cpan Compress-Raw-Lzma 2.224 main/code().($_scip-perl cpan Compress-Raw-Lzma 2.224 main/$_., $X) ; |
| 108 | last unless $status == LZMA_OK ; |
| 109 | |
| 110 | $Answer .= $X ; |
| 111 | } |
| 112 | |
| 113 | cmp_okscip-perl cpan Compress-Raw-Lzma 2.224 main/cmp_ok(). $status, '==', LZMA_OK, "code returned LZMA_OK" ; |
| 114 | |
| 115 | cmp_okscip-perl cpan Compress-Raw-Lzma 2.224 main/cmp_ok(). $x->flushscip-perl cpan Compress-Raw-Lzma 2.224 main/flush().($X), '==', LZMA_STREAM_END, "flush returned LZMA_OK" ; |
| 116 | $Answer .= $X ; |
| 117 | |
| 118 | isscip-perl cpan Compress-Raw-Lzma 2.224 main/is(). $x->uncompressedBytesscip-perl cpan Compress-Raw-Lzma 2.224 main/uncompressedBytes().(), lengthscip-perl cpan Compress-Raw-Lzma 2.224 main/length(). $hello, "uncompressedBytes ok" ; |
| 119 | isscip-perl cpan Compress-Raw-Lzma 2.224 main/is(). $x->compressedBytesscip-perl cpan Compress-Raw-Lzma 2.224 main/compressedBytes().(), lengthscip-perl cpan Compress-Raw-Lzma 2.224 main/length(). $Answer, "compressedBytes ok" ; |
| 120 | |
| 121 | cmp_okscip-perl cpan Compress-Raw-Lzma 2.224 main/cmp_ok(). $x->flushscip-perl cpan Compress-Raw-Lzma 2.224 main/flush().($X), '==', LZMA_STREAM_END, "flush returned LZMA_STREAM_END"; |
| 122 | $Answer .= $X ; |
| 123 | |
| 124 | #open F, ">/tmp/xx1"; print F $Answer ; close F; |
| 125 | my @Answer = splitscip-perl cpan Compress-Raw-Lzma 2.224 main/split().('', $Answer) ; |
| 126 | |
| 127 | my $k; |
| 128 | okscip-perl cpan Compress-Raw-Lzma 2.224 main/ok().(($k, $err) = $uncompress_class->newscip-perl cpan Compress-Raw-Lzma 2.224 main/new().(AppendOutput => 0, |
| 129 | ConsumeInput => 0)); |
| 130 | isa_okscip-perl cpan Compress-Raw-Lzma 2.224 main/isa_ok(). $k, "Compress::Raw::Lzma::Decoder" ; |
| 131 | cmp_okscip-perl cpan Compress-Raw-Lzma 2.224 main/cmp_ok(). $err, '==', LZMA_OK, "status is LZMA_OK" |
| 132 | or diagscip-perl cpan Compress-Raw-Lzma 2.224 main/diag(). "GOT $err\n"; |
| 133 | |
| 134 | isscip-perl cpan Compress-Raw-Lzma 2.224 main/is(). $k->compressedBytesscip-perl cpan Compress-Raw-Lzma 2.224 main/compressedBytes().(), 0, "compressedBytes() == 0" ; |
| 135 | isscip-perl cpan Compress-Raw-Lzma 2.224 main/is(). $k->uncompressedBytesscip-perl cpan Compress-Raw-Lzma 2.224 main/uncompressedBytes().(), 0, "uncompressedBytes() == 0" ; |
| 136 | my $GOT = ''; |
| 137 | my $Z; |
| 138 | $Z = 1 ;#x 2000 ; |
| 139 | foreach (@Answer) |
| 140 | { |
| 141 | $status = $k->codescip-perl cpan Compress-Raw-Lzma 2.224 main/code().($_scip-perl cpan Compress-Raw-Lzma 2.224 main/$_., $Z) ; |
| 142 | $GOT .= $Z ; |
| 143 | last if $status == LZMA_STREAM_END or $status != LZMA_OK ; |
| 144 | |
| 145 | } |
| 146 | |
| 147 | cmp_okscip-perl cpan Compress-Raw-Lzma 2.224 main/cmp_ok(). $status, '==', LZMA_STREAM_END, "Got LZMA_STREAM_END" ; |
| 148 | isscip-perl cpan Compress-Raw-Lzma 2.224 main/is(). $GOT, $hello, "uncompressed data matches ok" ; |
| 149 | isscip-perl cpan Compress-Raw-Lzma 2.224 main/is(). $k->compressedBytesscip-perl cpan Compress-Raw-Lzma 2.224 main/compressedBytes().(), lengthscip-perl cpan Compress-Raw-Lzma 2.224 main/length(). $Answer, "compressedBytes ok" ; |
| 150 | isscip-perl cpan Compress-Raw-Lzma 2.224 main/is(). $k->uncompressedBytesscip-perl cpan Compress-Raw-Lzma 2.224 main/uncompressedBytes().(), lengthscip-perl cpan Compress-Raw-Lzma 2.224 main/length(). $hello , "uncompressedBytes ok"; |
| 151 | |
| 152 | } |
| 153 | |
| 154 | |
| 155 | if (1) |
| 156 | { |
| 157 | # code/code - small buffer with a number |
| 158 | # ============================== |
| 159 | |
| 160 | my $hello = 6529 ; |
| 161 | |
| 162 | okscip-perl cpan Compress-Raw-Lzma 2.224 main/ok(). my ($x, $err) = $compress_class->newscip-perl cpan Compress-Raw-Lzma 2.224 main/new().(AppendOutput => 1) ; |
| 163 | okscip-perl cpan Compress-Raw-Lzma 2.224 main/ok(). $x ; |
| 164 | cmp_okscip-perl cpan Compress-Raw-Lzma 2.224 main/cmp_ok(). $err, '==', LZMA_OK ; |
| 165 | |
| 166 | my $status; |
| 167 | my $Answer = ''; |
| 168 | |
| 169 | cmp_okscip-perl cpan Compress-Raw-Lzma 2.224 main/cmp_ok(). $x->codescip-perl cpan Compress-Raw-Lzma 2.224 main/code().($hello, $Answer), '==', LZMA_OK ; |
| 170 | |
| 171 | cmp_okscip-perl cpan Compress-Raw-Lzma 2.224 main/cmp_ok(). $x->flushscip-perl cpan Compress-Raw-Lzma 2.224 main/flush().($Answer), '==', LZMA_STREAM_END, "flush returned LZMA_STREAM_END"; |
| 172 | |
| 173 | my @Answer = splitscip-perl cpan Compress-Raw-Lzma 2.224 main/split().('', $Answer) ; |
| 174 | |
| 175 | my $k; |
| 176 | okscip-perl cpan Compress-Raw-Lzma 2.224 main/ok().(($k, $err) = $uncompress_class->newscip-perl cpan Compress-Raw-Lzma 2.224 main/new().(AppendOutput => 1, |
| 177 | ConsumeInput => 0) ); |
| 178 | okscip-perl cpan Compress-Raw-Lzma 2.224 main/ok(). $k ; |
| 179 | cmp_okscip-perl cpan Compress-Raw-Lzma 2.224 main/cmp_ok(). $err, '==', LZMA_OK ; |
| 180 | |
| 181 | #my $GOT = ''; |
| 182 | my $GOT ; |
| 183 | foreach (@Answer) |
| 184 | { |
| 185 | $status = $k->codescip-perl cpan Compress-Raw-Lzma 2.224 main/code().($_scip-perl cpan Compress-Raw-Lzma 2.224 main/$_., $GOT) ; |
| 186 | last if $status == LZMA_STREAM_END or $status != LZMA_OK ; |
| 187 | |
| 188 | } |
| 189 | |
| 190 | cmp_okscip-perl cpan Compress-Raw-Lzma 2.224 main/cmp_ok(). $status, '==', LZMA_STREAM_END ; |
| 191 | isscip-perl cpan Compress-Raw-Lzma 2.224 main/is(). $GOT, $hello ; |
| 192 | |
| 193 | } |
| 194 | |
| 195 | if(1) |
| 196 | { |
| 197 | |
| 198 | # code/code options - AppendOutput |
| 199 | # ================================ |
| 200 | |
| 201 | # AppendOutput |
| 202 | # CRC |
| 203 | |
| 204 | my $hello = "I am a HAL 9000 computer" ; |
| 205 | my @hello = splitscip-perl cpan Compress-Raw-Lzma 2.224 main/split().('', $hello) ; |
| 206 | |
| 207 | okscip-perl cpan Compress-Raw-Lzma 2.224 main/ok(). my ($x, $err) = $compress_class->newscip-perl cpan Compress-Raw-Lzma 2.224 main/new().(AppendOutput => 1), " Created lzma object" ; |
| 208 | okscip-perl cpan Compress-Raw-Lzma 2.224 main/ok(). $x ; |
| 209 | cmp_okscip-perl cpan Compress-Raw-Lzma 2.224 main/cmp_ok(). $err, '==', LZMA_OK, "Status is LZMA_OK" ; |
| 210 | |
| 211 | my $status; |
| 212 | my $X; |
| 213 | foreach (@hello) |
| 214 | { |
| 215 | $status = $x->codescip-perl cpan Compress-Raw-Lzma 2.224 main/code().($_scip-perl cpan Compress-Raw-Lzma 2.224 main/$_., $X) ; |
| 216 | last unless $status == LZMA_OK ; |
| 217 | } |
| 218 | |
| 219 | cmp_okscip-perl cpan Compress-Raw-Lzma 2.224 main/cmp_ok(). $status, '==', LZMA_OK ; |
| 220 | |
| 221 | cmp_okscip-perl cpan Compress-Raw-Lzma 2.224 main/cmp_ok(). $x->flushscip-perl cpan Compress-Raw-Lzma 2.224 main/flush().($X), '==', LZMA_STREAM_END ; |
| 222 | |
| 223 | |
| 224 | my @Answer = splitscip-perl cpan Compress-Raw-Lzma 2.224 main/split().('', $X) ; |
| 225 | |
| 226 | my $k; |
| 227 | okscip-perl cpan Compress-Raw-Lzma 2.224 main/ok().(($k, $err) = $uncompress_class->newscip-perl cpan Compress-Raw-Lzma 2.224 main/new().( {-AppendOutput =>1})); |
| 228 | okscip-perl cpan Compress-Raw-Lzma 2.224 main/ok(). $k ; |
| 229 | cmp_okscip-perl cpan Compress-Raw-Lzma 2.224 main/cmp_ok(). $err, '==', LZMA_OK ; |
| 230 | |
| 231 | my $Z; |
| 232 | foreach (@Answer) |
| 233 | { |
| 234 | $status = $k->codescip-perl cpan Compress-Raw-Lzma 2.224 main/code().($_scip-perl cpan Compress-Raw-Lzma 2.224 main/$_., $Z) ; |
| 235 | last if $status == LZMA_STREAM_END or $status != LZMA_OK ; |
| 236 | |
| 237 | } |
| 238 | |
| 239 | cmp_okscip-perl cpan Compress-Raw-Lzma 2.224 main/cmp_ok(). $status, '==', LZMA_STREAM_END ; |
| 240 | isscip-perl cpan Compress-Raw-Lzma 2.224 main/is(). $Z, $hello ; |
| 241 | } |
| 242 | |
| 243 | |
| 244 | if(1) |
| 245 | { |
| 246 | |
| 247 | titlescip-perl cpan Compress-Raw-Lzma 2.224 main/title(). "lzma - larger buffer"; |
| 248 | # ============================== |
| 249 | |
| 250 | # generate a long random string |
| 251 | my $contents = '' ; |
| 252 | foreach (1 .. 50000) |
| 253 | { $contents .= chrscip-perl cpan Compress-Raw-Lzma 2.224 main/chr(). intscip-perl cpan Compress-Raw-Lzma 2.224 main/int(). randscip-perl cpan Compress-Raw-Lzma 2.224 main/rand(). 255 } |
| 254 | |
| 255 | |
| 256 | okscip-perl cpan Compress-Raw-Lzma 2.224 main/ok(). my ($x, $err) = $compress_class->newscip-perl cpan Compress-Raw-Lzma 2.224 main/new().(AppendOutput => 0) ; |
| 257 | okscip-perl cpan Compress-Raw-Lzma 2.224 main/ok(). $x, " lzma object ok" ; |
| 258 | cmp_okscip-perl cpan Compress-Raw-Lzma 2.224 main/cmp_ok(). $err, '==', LZMA_OK," status is LZMA_OK" ; |
| 259 | |
| 260 | isscip-perl cpan Compress-Raw-Lzma 2.224 main/is(). $x->uncompressedBytesscip-perl cpan Compress-Raw-Lzma 2.224 main/uncompressedBytes().(), 0, " uncompressedBytes() == 0" ; |
| 261 | isscip-perl cpan Compress-Raw-Lzma 2.224 main/is(). $x->compressedBytesscip-perl cpan Compress-Raw-Lzma 2.224 main/compressedBytes().(), 0, " compressedBytes() == 0" ; |
| 262 | |
| 263 | my (%X, $Y, %Z, $X, $Z); |
| 264 | #cmp_ok $x->code($contents, $X{key}), '==', LZMA_OK ; |
| 265 | my $status = $x->codescip-perl cpan Compress-Raw-Lzma 2.224 main/code().($contents, $X); |
| 266 | #cmp_ok $x->code($contents, $X), '==', LZMA_OK, " compressed ok" ; |
| 267 | cmp_okscip-perl cpan Compress-Raw-Lzma 2.224 main/cmp_ok(). $status, '==', LZMA_OK, " compressed ok" ; |
| 268 | |
| 269 | #$Y = $X{key} ; |
| 270 | $Y = $X ; |
| 271 | |
| 272 | |
| 273 | #cmp_ok $x->flush($X{key}), '==', LZMA_OK ; |
| 274 | #$Y .= $X{key} ; |
| 275 | cmp_okscip-perl cpan Compress-Raw-Lzma 2.224 main/cmp_ok(). $x->flushscip-perl cpan Compress-Raw-Lzma 2.224 main/flush().($X), '==', LZMA_STREAM_END ; |
| 276 | $Y .= $X ; |
| 277 | |
| 278 | |
| 279 | |
| 280 | my $keep = $Y ; |
| 281 | |
| 282 | my $k; |
| 283 | okscip-perl cpan Compress-Raw-Lzma 2.224 main/ok().(($k, $err) = $uncompress_class->newscip-perl cpan Compress-Raw-Lzma 2.224 main/new().(AppendOutput => 0, |
| 284 | ConsumeInput => 0) ); |
| 285 | okscip-perl cpan Compress-Raw-Lzma 2.224 main/ok(). $k ; |
| 286 | cmp_okscip-perl cpan Compress-Raw-Lzma 2.224 main/cmp_ok(). $err, '==', LZMA_OK ; |
| 287 | |
| 288 | #cmp_ok $k->code($Y, $Z{key}), '==', LZMA_STREAM_END ; |
| 289 | #ok $contents eq $Z{key} ; |
| 290 | cmp_okscip-perl cpan Compress-Raw-Lzma 2.224 main/cmp_ok(). $k->codescip-perl cpan Compress-Raw-Lzma 2.224 main/code().($Y, $Z), '==', LZMA_STREAM_END ; |
| 291 | ok $contents eqscip-perl cpan Compress-Raw-Lzma 2.224 main/eq(). $Z ; |
| 292 | |
| 293 | # redo deflate with AppendOutput |
| 294 | |
| 295 | okscip-perl cpan Compress-Raw-Lzma 2.224 main/ok(). (($k, $err) = $uncompress_class->newscip-perl cpan Compress-Raw-Lzma 2.224 main/new().(AppendOutput => 1, |
| 296 | ConsumeInput => 0)) ; |
| 297 | okscip-perl cpan Compress-Raw-Lzma 2.224 main/ok(). $k ; |
| 298 | cmp_okscip-perl cpan Compress-Raw-Lzma 2.224 main/cmp_ok(). $err, '==', LZMA_OK ; |
| 299 | |
| 300 | my $s ; |
| 301 | my $out ; |
| 302 | my @bits = splitscip-perl cpan Compress-Raw-Lzma 2.224 main/split().('', $keep) ; |
| 303 | foreach my $bit (@bits) { |
| 304 | $s = $k->codescip-perl cpan Compress-Raw-Lzma 2.224 main/code().($bit, $out) ; |
| 305 | } |
| 306 | |
| 307 | cmp_okscip-perl cpan Compress-Raw-Lzma 2.224 main/cmp_ok(). $s, '==', LZMA_STREAM_END ; |
| 308 | |
| 309 | ok $contents eqscip-perl cpan Compress-Raw-Lzma 2.224 main/eq(). $out ; |
| 310 | |
| 311 | |
| 312 | } |
| 313 | |
| 314 | |
| 315 | for my $consume ( 0 .. 1) |
| 316 | { |
| 317 | titlescip-perl cpan Compress-Raw-Lzma 2.224 main/title(). "lzma - check remaining buffer after LZMA_STREAM_END, Consume $consume"; |
| 318 | |
| 319 | okscip-perl cpan Compress-Raw-Lzma 2.224 main/ok(). my $x = $compress_class->newscip-perl cpan Compress-Raw-Lzma 2.224 main/new().(AppendOutput => 0) ; |
| 320 | |
| 321 | my ($X, $Y, $Z); |
| 322 | cmp_okscip-perl cpan Compress-Raw-Lzma 2.224 main/cmp_ok(). $x->codescip-perl cpan Compress-Raw-Lzma 2.224 main/code().($hello, $X), '==', LZMA_OK; |
| 323 | cmp_okscip-perl cpan Compress-Raw-Lzma 2.224 main/cmp_ok(). $x->flushscip-perl cpan Compress-Raw-Lzma 2.224 main/flush().($Y), '==', LZMA_STREAM_END; |
| 324 | $X .= $Y ; |
| 325 | |
| 326 | okscip-perl cpan Compress-Raw-Lzma 2.224 main/ok(). my $k = $uncompress_class->newscip-perl cpan Compress-Raw-Lzma 2.224 main/new().(AppendOutput => 0, |
| 327 | ConsumeInput => $consume) ; |
| 328 | |
| 329 | my $first = substrscip-perl cpan Compress-Raw-Lzma 2.224 main/substr().($X, 0, 2) ; |
| 330 | my $remember_first = $first ; |
| 331 | my $last = substrscip-perl cpan Compress-Raw-Lzma 2.224 main/substr().($X, 2) ; |
| 332 | cmp_okscip-perl cpan Compress-Raw-Lzma 2.224 main/cmp_ok(). $k->codescip-perl cpan Compress-Raw-Lzma 2.224 main/code().($first, $Z), '==', LZMA_OK; |
| 333 | if ($consume) { |
| 334 | ok $first eq "" ; |
| 335 | } |
| 336 | else { |
| 337 | ok $first eqscip-perl cpan Compress-Raw-Lzma 2.224 main/eq(). $remember_first ; |
| 338 | } |
| 339 | |
| 340 | my $T ; |
| 341 | $last .= "appendage" ; |
| 342 | my $remember_last = $last ; |
| 343 | cmp_okscip-perl cpan Compress-Raw-Lzma 2.224 main/cmp_ok(). $k->codescip-perl cpan Compress-Raw-Lzma 2.224 main/code().($last, $T), '==', LZMA_STREAM_END; |
| 344 | isscip-perl cpan Compress-Raw-Lzma 2.224 main/is(). $hello, $Z . $T ; |
| 345 | if ($consume) { |
| 346 | isscip-perl cpan Compress-Raw-Lzma 2.224 main/is(). $last, "appendage" ; |
| 347 | } |
| 348 | else { |
| 349 | isscip-perl cpan Compress-Raw-Lzma 2.224 main/is(). $last, $remember_last ; |
| 350 | } |
| 351 | |
| 352 | } |
| 353 | |
| 354 | |
| 355 | { |
| 356 | titlescip-perl cpan Compress-Raw-Lzma 2.224 main/title(). "ConsumeInput and a read-only buffer trapped" ; |
| 357 | |
| 358 | okscip-perl cpan Compress-Raw-Lzma 2.224 main/ok(). my $k = $uncompress_class->newscip-perl cpan Compress-Raw-Lzma 2.224 main/new().(AppendOutput => 0, |
| 359 | ConsumeInput => 1) ; |
| 360 | |
| 361 | my $Z; |
| 362 | eval { $k->codescip-perl cpan Compress-Raw-Lzma 2.224 main/code().("abc", $Z) ; }; |
| 363 | likescip-perl cpan Compress-Raw-Lzma 2.224 main/like(). $@scip-perl cpan Compress-Raw-Lzma 2.224 main/`$@`., mkErrscip-perl cpan Compress-Raw-Lzma 2.224 main/mkErr().("Compress::Raw::Lzma::Decoder::code input parameter cannot be read-only when ConsumeInput is specified"); |
| 364 | |
| 365 | } |
| 366 | |
| 367 | foreach (1 .. 2) |
| 368 | { |
| 369 | next if $]scip-perl cpan Compress-Raw-Lzma 2.224 main/`$]`. < 5.005 ; |
| 370 | |
| 371 | titlescip-perl cpan Compress-Raw-Lzma 2.224 main/title(). 'test lzma with a substr'; |
| 372 | |
| 373 | my $contents = '' ; |
| 374 | foreach (1 .. 5000) |
| 375 | { $contents .= chrscip-perl cpan Compress-Raw-Lzma 2.224 main/chr(). intscip-perl cpan Compress-Raw-Lzma 2.224 main/int(). randscip-perl cpan Compress-Raw-Lzma 2.224 main/rand(). 255 } |
| 376 | okscip-perl cpan Compress-Raw-Lzma 2.224 main/ok(). my $x = $compress_class->newscip-perl cpan Compress-Raw-Lzma 2.224 main/new().(AppendOutput => 1) ; |
| 377 | |
| 378 | my $X ; |
| 379 | my $status = $x->codescip-perl cpan Compress-Raw-Lzma 2.224 main/code().(substrscip-perl cpan Compress-Raw-Lzma 2.224 main/substr().($contents,0), $X); |
| 380 | cmp_okscip-perl cpan Compress-Raw-Lzma 2.224 main/cmp_ok(). $status, '==', LZMA_OK ; |
| 381 | |
| 382 | cmp_okscip-perl cpan Compress-Raw-Lzma 2.224 main/cmp_ok(). $x->flushscip-perl cpan Compress-Raw-Lzma 2.224 main/flush().($X), '==', LZMA_STREAM_END ; |
| 383 | |
| 384 | my $append = "Appended" ; |
| 385 | $X .= $append ; |
| 386 | |
| 387 | okscip-perl cpan Compress-Raw-Lzma 2.224 main/ok(). my $k = $uncompress_class->newscip-perl cpan Compress-Raw-Lzma 2.224 main/new().(AppendOutput => 1, |
| 388 | ConsumeInput => 1) ; |
| 389 | |
| 390 | my $Z; |
| 391 | my $keep = $X ; |
| 392 | $status = $k->codescip-perl cpan Compress-Raw-Lzma 2.224 main/code().(substrscip-perl cpan Compress-Raw-Lzma 2.224 main/substr().($X, 0), $Z) ; |
| 393 | |
| 394 | cmp_okscip-perl cpan Compress-Raw-Lzma 2.224 main/cmp_ok(). $status, '==', LZMA_STREAM_END ; |
| 395 | #print "status $status X [$X]\n" ; |
| 396 | isscip-perl cpan Compress-Raw-Lzma 2.224 main/is(). $contents, $Z ; |
| 397 | ok $X eqscip-perl cpan Compress-Raw-Lzma 2.224 main/eq(). $append; |
| 398 | #is length($X), length($append); |
| 399 | #ok $X eq $keep; |
| 400 | #is length($X), length($keep); |
| 401 | } |
| 402 | |
| 403 | titlescip-perl cpan Compress-Raw-Lzma 2.224 main/title(). 'Looping Append test - checks that deRef_l resets the output buffer'; |
| 404 | foreach (1 .. 2) |
| 405 | { |
| 406 | |
| 407 | my $hello = "I am a HAL 9000 computer" ; |
| 408 | my @hello = splitscip-perl cpan Compress-Raw-Lzma 2.224 main/split().('', $hello) ; |
| 409 | my ($err, $x, $X, $status); |
| 410 | |
| 411 | okscip-perl cpan Compress-Raw-Lzma 2.224 main/ok().( ($x, $err) = $compress_class->newscip-perl cpan Compress-Raw-Lzma 2.224 main/new().(AppendOutput => 0) ); |
| 412 | okscip-perl cpan Compress-Raw-Lzma 2.224 main/ok(). $x ; |
| 413 | cmp_okscip-perl cpan Compress-Raw-Lzma 2.224 main/cmp_ok(). $err, '==', LZMA_OK ; |
| 414 | |
| 415 | $X = "" ; |
| 416 | my $Answer = ''; |
| 417 | foreach (@hello) |
| 418 | { |
| 419 | $status = $x->codescip-perl cpan Compress-Raw-Lzma 2.224 main/code().($_scip-perl cpan Compress-Raw-Lzma 2.224 main/$_., $X) ; |
| 420 | last unless $status == LZMA_OK ; |
| 421 | |
| 422 | $Answer .= $X ; |
| 423 | } |
| 424 | |
| 425 | cmp_okscip-perl cpan Compress-Raw-Lzma 2.224 main/cmp_ok(). $status, '==', LZMA_OK ; |
| 426 | |
| 427 | cmp_okscip-perl cpan Compress-Raw-Lzma 2.224 main/cmp_ok(). $x->flushscip-perl cpan Compress-Raw-Lzma 2.224 main/flush().($X), '==', LZMA_STREAM_END ; |
| 428 | $Answer .= $X ; |
| 429 | |
| 430 | my @Answer = splitscip-perl cpan Compress-Raw-Lzma 2.224 main/split().('', $Answer) ; |
| 431 | |
| 432 | my $k; |
| 433 | okscip-perl cpan Compress-Raw-Lzma 2.224 main/ok().(($k, $err) = $uncompress_class->newscip-perl cpan Compress-Raw-Lzma 2.224 main/new().(AppendOutput => 1, |
| 434 | ConsumeInput => 0) ); |
| 435 | okscip-perl cpan Compress-Raw-Lzma 2.224 main/ok(). $k ; |
| 436 | cmp_okscip-perl cpan Compress-Raw-Lzma 2.224 main/cmp_ok(). $err, '==', LZMA_OK ; |
| 437 | |
| 438 | my $GOT ; |
| 439 | my $Z; |
| 440 | $Z = 1 ;#x 2000 ; |
| 441 | foreach (@Answer) |
| 442 | { |
| 443 | $status = $k->codescip-perl cpan Compress-Raw-Lzma 2.224 main/code().($_scip-perl cpan Compress-Raw-Lzma 2.224 main/$_., $GOT) ; |
| 444 | last if $status == LZMA_STREAM_END or $status != LZMA_OK ; |
| 445 | } |
| 446 | |
| 447 | cmp_okscip-perl cpan Compress-Raw-Lzma 2.224 main/cmp_ok(). $status, '==', LZMA_STREAM_END ; |
| 448 | isscip-perl cpan Compress-Raw-Lzma 2.224 main/is(). $GOT, $hello ; |
| 449 | |
| 450 | } |
| 451 | |
| 452 | if ($]scip-perl cpan Compress-Raw-Lzma 2.224 main/`$]`. >= 5.005) |
| 453 | { |
| 454 | titlescip-perl cpan Compress-Raw-Lzma 2.224 main/title(). 'test lzma input parameter via substr'; |
| 455 | |
| 456 | my $hello = "I am a HAL 9000 computer" ; |
| 457 | my $data = $hello ; |
| 458 | |
| 459 | my($X, $Z); |
| 460 | |
| 461 | okscip-perl cpan Compress-Raw-Lzma 2.224 main/ok(). my $x = $compress_class->newscip-perl cpan Compress-Raw-Lzma 2.224 main/new().(AppendOutput => 1); |
| 462 | |
| 463 | cmp_okscip-perl cpan Compress-Raw-Lzma 2.224 main/cmp_ok(). $x->codescip-perl cpan Compress-Raw-Lzma 2.224 main/code().($data, $X), '==', LZMA_OK ; |
| 464 | |
| 465 | cmp_okscip-perl cpan Compress-Raw-Lzma 2.224 main/cmp_ok(). $x->flushscip-perl cpan Compress-Raw-Lzma 2.224 main/flush().($X), '==', LZMA_STREAM_END ; |
| 466 | |
| 467 | my $append = "Appended" ; |
| 468 | $X .= $append ; |
| 469 | my $keep = $X ; |
| 470 | |
| 471 | okscip-perl cpan Compress-Raw-Lzma 2.224 main/ok(). my $k = $uncompress_class->newscip-perl cpan Compress-Raw-Lzma 2.224 main/new().( AppendOutput => 1, |
| 472 | ConsumeInput => 1); |
| 473 | |
| 474 | # cmp_ok $k->code(substr($X, 0, -1), $Z), '==', LZMA_STREAM_END ; ; |
| 475 | cmp_okscip-perl cpan Compress-Raw-Lzma 2.224 main/cmp_ok(). $k->codescip-perl cpan Compress-Raw-Lzma 2.224 main/code().(substrscip-perl cpan Compress-Raw-Lzma 2.224 main/substr().($X, 0), $Z), '==', LZMA_STREAM_END ; ; |
| 476 | |
| 477 | ok $hello eqscip-perl cpan Compress-Raw-Lzma 2.224 main/eq(). $Z ; |
| 478 | isscip-perl cpan Compress-Raw-Lzma 2.224 main/is(). $X, $append; |
| 479 | |
| 480 | $X = $keep ; |
| 481 | $Z = ''; |
| 482 | ok $k = $uncompress_class->new( AppendOutput => 1, |
| 483 | ConsumeInput => 0); |
| 484 | |
| 485 | cmp_okscip-perl cpan Compress-Raw-Lzma 2.224 main/cmp_ok(). $k->codescip-perl cpan Compress-Raw-Lzma 2.224 main/code().(substrscip-perl cpan Compress-Raw-Lzma 2.224 main/substr().($X, 0, -1), $Z), '==', LZMA_STREAM_END ; ; |
| 486 | #cmp_ok $k->code(substr($X, 0), $Z), '==', LZMA_STREAM_END ; ; |
| 487 | |
| 488 | ok $hello eqscip-perl cpan Compress-Raw-Lzma 2.224 main/eq(). $Z ; |
| 489 | isscip-perl cpan Compress-Raw-Lzma 2.224 main/is(). $X, $keep; |
| 490 | |
| 491 | } |
| 492 | |
| 493 | |
| 494 | { |
| 495 | titlescip-perl cpan Compress-Raw-Lzma 2.224 main/title(). 'RT#132734: test inflate append OOK output parameter'; |
| 496 | # https://github.com/pmqs/Compress-Raw-Bzip2/issues/2 |
| 497 | |
| 498 | my $hello = "I am a HAL 9000 computer" ; |
| 499 | my $data = $hello ; |
| 500 | |
| 501 | my($X, $Z); |
| 502 | |
| 503 | okscip-perl cpan Compress-Raw-Lzma 2.224 main/ok(). my $x = $compress_class->newscip-perl cpan Compress-Raw-Lzma 2.224 main/new().( {-AppendOutput => 1} ); |
| 504 | |
| 505 | cmp_okscip-perl cpan Compress-Raw-Lzma 2.224 main/cmp_ok(). $x->codescip-perl cpan Compress-Raw-Lzma 2.224 main/code().($data, $X), '==', LZMA_OK ; |
| 506 | |
| 507 | cmp_okscip-perl cpan Compress-Raw-Lzma 2.224 main/cmp_ok(). $x->flushscip-perl cpan Compress-Raw-Lzma 2.224 main/flush().($X), '==', LZMA_STREAM_END ; |
| 508 | |
| 509 | okscip-perl cpan Compress-Raw-Lzma 2.224 main/ok(). my $k = $uncompress_class->newscip-perl cpan Compress-Raw-Lzma 2.224 main/new().( {-AppendOutput => 1, |
| 510 | -ConsumeInput => 1} ) ; |
| 511 | $Z = 'prev. ' ; |
| 512 | substrscip-perl cpan Compress-Raw-Lzma 2.224 main/substr().($Z, 0, 4, ''); # chop off first 4 characters using offset |
| 513 | cmp_okscip-perl cpan Compress-Raw-Lzma 2.224 main/cmp_ok(). $Z, 'eq', '. ' ; |
| 514 | |
| 515 | # use Devel::Peek ; Dump($Z) ; # shows OOK flag |
| 516 | |
| 517 | # if (1) { # workaround |
| 518 | # my $prev = $Z; |
| 519 | # undef $Z ; |
| 520 | # $Z = $prev ; |
| 521 | # } |
| 522 | |
| 523 | cmp_okscip-perl cpan Compress-Raw-Lzma 2.224 main/cmp_ok(). $k->codescip-perl cpan Compress-Raw-Lzma 2.224 main/code().($X, $Z), '==', LZMA_STREAM_END ; |
| 524 | # use Devel::Peek ; Dump($Z) ; # No OOK flag |
| 525 | |
| 526 | cmp_okscip-perl cpan Compress-Raw-Lzma 2.224 main/cmp_ok(). $Z, 'eq', ". $hello" ; |
| 527 | } |
| 528 | |
| 529 | |
| 530 | { |
| 531 | titlescip-perl cpan Compress-Raw-Lzma 2.224 main/title(). 'RT#132734: test deflate append OOK output parameter'; |
| 532 | # https://github.com/pmqs/Compress-Raw-Bzip2/issues/2 |
| 533 | |
| 534 | my $hello = "I am a HAL 9000 computer" ; |
| 535 | my $data = $hello ; |
| 536 | |
| 537 | my($X, $Z); |
| 538 | |
| 539 | $X = 'prev. ' ; |
| 540 | substrscip-perl cpan Compress-Raw-Lzma 2.224 main/substr().($X, 0, 6, ''); # chop off all characters using offset |
| 541 | cmp_okscip-perl cpan Compress-Raw-Lzma 2.224 main/cmp_ok(). $X, 'eq', '' ; |
| 542 | |
| 543 | # use Devel::Peek ; Dump($X) ; # shows OOK flag |
| 544 | |
| 545 | # if (1) { # workaround |
| 546 | # my $prev = $Z; |
| 547 | # undef $Z ; |
| 548 | # $Z = $prev ; |
| 549 | # } |
| 550 | |
| 551 | okscip-perl cpan Compress-Raw-Lzma 2.224 main/ok(). my $x = $compress_class->newscip-perl cpan Compress-Raw-Lzma 2.224 main/new().( { -AppendOutput => 1 } ); |
| 552 | |
| 553 | cmp_okscip-perl cpan Compress-Raw-Lzma 2.224 main/cmp_ok(). $x->codescip-perl cpan Compress-Raw-Lzma 2.224 main/code().($data, $X), '==', LZMA_OK ; |
| 554 | |
| 555 | cmp_okscip-perl cpan Compress-Raw-Lzma 2.224 main/cmp_ok(). $x->flushscip-perl cpan Compress-Raw-Lzma 2.224 main/flush().($X), '==', LZMA_STREAM_END ; |
| 556 | |
| 557 | okscip-perl cpan Compress-Raw-Lzma 2.224 main/ok(). my $k = $uncompress_class->newscip-perl cpan Compress-Raw-Lzma 2.224 main/new().( {-AppendOutput => 1, |
| 558 | -ConsumeInput => 1} ) ; |
| 559 | cmp_okscip-perl cpan Compress-Raw-Lzma 2.224 main/cmp_ok(). $k->codescip-perl cpan Compress-Raw-Lzma 2.224 main/code().($X, $Z), '==', LZMA_STREAM_END ; |
| 560 | |
| 561 | isscip-perl cpan Compress-Raw-Lzma 2.224 main/is(). $Z, $hello ; |
| 562 | } |
| 563 | |
| 564 | |
| 565 | { |
| 566 | titlescip-perl cpan Compress-Raw-Lzma 2.224 main/title(). 'RT#132734: test flush append OOK output parameter'; |
| 567 | # https://github.com/pmqs/Compress-Raw-Bzip2/issues/2 |
| 568 | |
| 569 | my $hello = "I am a HAL 9000 computer" ; |
| 570 | my $data = $hello ; |
| 571 | |
| 572 | my($X, $Z); |
| 573 | |
| 574 | my $F = 'prev. ' ; |
| 575 | substrscip-perl cpan Compress-Raw-Lzma 2.224 main/substr().($F, 0, 6, ''); # chop off all characters using offset |
| 576 | cmp_okscip-perl cpan Compress-Raw-Lzma 2.224 main/cmp_ok(). $F, 'eq', '' ; |
| 577 | |
| 578 | # use Devel::Peek ; Dump($F) ; # shows OOK flag |
| 579 | |
| 580 | okscip-perl cpan Compress-Raw-Lzma 2.224 main/ok(). my $x = $compress_class->newscip-perl cpan Compress-Raw-Lzma 2.224 main/new().( {-AppendOutput => 1 }); |
| 581 | |
| 582 | cmp_okscip-perl cpan Compress-Raw-Lzma 2.224 main/cmp_ok(). $x->codescip-perl cpan Compress-Raw-Lzma 2.224 main/code().($data, $X), '==', LZMA_OK ; |
| 583 | |
| 584 | cmp_okscip-perl cpan Compress-Raw-Lzma 2.224 main/cmp_ok(). $x->flushscip-perl cpan Compress-Raw-Lzma 2.224 main/flush().($F), '==', LZMA_STREAM_END ; |
| 585 | |
| 586 | okscip-perl cpan Compress-Raw-Lzma 2.224 main/ok(). my $k = $uncompress_class->newscip-perl cpan Compress-Raw-Lzma 2.224 main/new().( {-AppendOutput => 1, |
| 587 | -ConsumeInput => 1} ) ; |
| 588 | cmp_okscip-perl cpan Compress-Raw-Lzma 2.224 main/cmp_ok(). $k->codescip-perl cpan Compress-Raw-Lzma 2.224 main/code().($X . $F, $Z), '==', LZMA_STREAM_END ; |
| 589 | |
| 590 | isscip-perl cpan Compress-Raw-Lzma 2.224 main/is(). $Z, $hello ; |
| 591 | } |
| 592 | |
| 593 | titlescip-perl cpan Compress-Raw-Lzma 2.224 main/title(). 'Looping Append test with substr output - substr the end of the string'; |
| 594 | foreach (1 .. 2) |
| 595 | { |
| 596 | |
| 597 | my $hello = "I am a HAL 9000 computer" ; |
| 598 | my @hello = splitscip-perl cpan Compress-Raw-Lzma 2.224 main/split().('', $hello) ; |
| 599 | my ($err, $x, $X, $status); |
| 600 | |
| 601 | okscip-perl cpan Compress-Raw-Lzma 2.224 main/ok().( ($x, $err) = $compress_class->newscip-perl cpan Compress-Raw-Lzma 2.224 main/new(). (AppendOutput => 1) ); |
| 602 | okscip-perl cpan Compress-Raw-Lzma 2.224 main/ok(). $x ; |
| 603 | cmp_okscip-perl cpan Compress-Raw-Lzma 2.224 main/cmp_ok(). $err, '==', LZMA_OK ; |
| 604 | |
| 605 | $X = "" ; |
| 606 | my $Answer = ''; |
| 607 | foreach (@hello) |
| 608 | { |
| 609 | $status = $x->codescip-perl cpan Compress-Raw-Lzma 2.224 main/code().($_scip-perl cpan Compress-Raw-Lzma 2.224 main/$_., substrscip-perl cpan Compress-Raw-Lzma 2.224 main/substr().($Answer, lengthscip-perl cpan Compress-Raw-Lzma 2.224 main/length().($Answer))) ; |
| 610 | last unless $status == LZMA_OK ; |
| 611 | |
| 612 | } |
| 613 | |
| 614 | cmp_okscip-perl cpan Compress-Raw-Lzma 2.224 main/cmp_ok(). $status, '==', LZMA_OK ; |
| 615 | |
| 616 | cmp_okscip-perl cpan Compress-Raw-Lzma 2.224 main/cmp_ok(). $x->flushscip-perl cpan Compress-Raw-Lzma 2.224 main/flush().(substrscip-perl cpan Compress-Raw-Lzma 2.224 main/substr().($Answer, lengthscip-perl cpan Compress-Raw-Lzma 2.224 main/length().($Answer))), '==', LZMA_STREAM_END ; |
| 617 | |
| 618 | my @Answer = splitscip-perl cpan Compress-Raw-Lzma 2.224 main/split().('', $Answer) ; |
| 619 | |
| 620 | my $k; |
| 621 | okscip-perl cpan Compress-Raw-Lzma 2.224 main/ok().(($k, $err) = $uncompress_class->newscip-perl cpan Compress-Raw-Lzma 2.224 main/new().(AppendOutput => 1, |
| 622 | ConsumeInput => 0) ); |
| 623 | okscip-perl cpan Compress-Raw-Lzma 2.224 main/ok(). $k ; |
| 624 | cmp_okscip-perl cpan Compress-Raw-Lzma 2.224 main/cmp_ok(). $err, '==', LZMA_OK ; |
| 625 | |
| 626 | my $GOT = ''; |
| 627 | my $Z; |
| 628 | $Z = 1 ;#x 2000 ; |
| 629 | foreach (@Answer) |
| 630 | { |
| 631 | $status = $k->codescip-perl cpan Compress-Raw-Lzma 2.224 main/code().($_scip-perl cpan Compress-Raw-Lzma 2.224 main/$_., substrscip-perl cpan Compress-Raw-Lzma 2.224 main/substr().($GOT, lengthscip-perl cpan Compress-Raw-Lzma 2.224 main/length().($GOT))) ; |
| 632 | last if $status == LZMA_STREAM_END or $status != LZMA_OK ; |
| 633 | } |
| 634 | |
| 635 | cmp_okscip-perl cpan Compress-Raw-Lzma 2.224 main/cmp_ok(). $status, '==', LZMA_STREAM_END ; |
| 636 | isscip-perl cpan Compress-Raw-Lzma 2.224 main/is(). $GOT, $hello ; |
| 637 | |
| 638 | } |
| 639 | |
| 640 | titlescip-perl cpan Compress-Raw-Lzma 2.224 main/title(). 'Looping Append test with substr output - substr the complete string'; |
| 641 | foreach (1 .. 2) |
| 642 | { |
| 643 | |
| 644 | my $hello = "I am a HAL 9000 computer" ; |
| 645 | my @hello = splitscip-perl cpan Compress-Raw-Lzma 2.224 main/split().('', $hello) ; |
| 646 | my ($err, $x, $X, $status); |
| 647 | |
| 648 | okscip-perl cpan Compress-Raw-Lzma 2.224 main/ok().( ($x, $err) = $compress_class->newscip-perl cpan Compress-Raw-Lzma 2.224 main/new(). (AppendOutput => 1) ); |
| 649 | okscip-perl cpan Compress-Raw-Lzma 2.224 main/ok(). $x ; |
| 650 | cmp_okscip-perl cpan Compress-Raw-Lzma 2.224 main/cmp_ok(). $err, '==', LZMA_OK ; |
| 651 | |
| 652 | $X = "" ; |
| 653 | my $Answer = ''; |
| 654 | foreach (@hello) |
| 655 | { |
| 656 | $status = $x->codescip-perl cpan Compress-Raw-Lzma 2.224 main/code().($_scip-perl cpan Compress-Raw-Lzma 2.224 main/$_., substrscip-perl cpan Compress-Raw-Lzma 2.224 main/substr().($Answer, 0)) ; |
| 657 | last unless $status == LZMA_OK ; |
| 658 | |
| 659 | } |
| 660 | |
| 661 | cmp_okscip-perl cpan Compress-Raw-Lzma 2.224 main/cmp_ok(). $status, '==', LZMA_OK ; |
| 662 | |
| 663 | cmp_okscip-perl cpan Compress-Raw-Lzma 2.224 main/cmp_ok(). $x->flushscip-perl cpan Compress-Raw-Lzma 2.224 main/flush().(substrscip-perl cpan Compress-Raw-Lzma 2.224 main/substr().($Answer, 0)), '==', LZMA_STREAM_END ; |
| 664 | |
| 665 | my @Answer = splitscip-perl cpan Compress-Raw-Lzma 2.224 main/split().('', $Answer) ; |
| 666 | |
| 667 | # append, consume, limit |
| 668 | my $k; |
| 669 | okscip-perl cpan Compress-Raw-Lzma 2.224 main/ok().(($k, $err) = $uncompress_class->newscip-perl cpan Compress-Raw-Lzma 2.224 main/new().(AppendOutput => 1, |
| 670 | ConsumeInput => 0) ); |
| 671 | okscip-perl cpan Compress-Raw-Lzma 2.224 main/ok(). $k ; |
| 672 | cmp_okscip-perl cpan Compress-Raw-Lzma 2.224 main/cmp_ok(). $err, '==', LZMA_OK ; |
| 673 | |
| 674 | my $GOT = ''; |
| 675 | my $Z; |
| 676 | $Z = 1 ;#x 2000 ; |
| 677 | foreach (@Answer) |
| 678 | { |
| 679 | $status = $k->codescip-perl cpan Compress-Raw-Lzma 2.224 main/code().($_scip-perl cpan Compress-Raw-Lzma 2.224 main/$_., substrscip-perl cpan Compress-Raw-Lzma 2.224 main/substr().($GOT, 0)) ; |
| 680 | last if $status == LZMA_STREAM_END or $status != LZMA_OK ; |
| 681 | } |
| 682 | |
| 683 | cmp_okscip-perl cpan Compress-Raw-Lzma 2.224 main/cmp_ok(). $status, '==', LZMA_STREAM_END ; |
| 684 | isscip-perl cpan Compress-Raw-Lzma 2.224 main/is(). $GOT, $hello ; |
| 685 | } |
| 686 | |
| 687 | } |
| 688 | |
| 689 | for my $class ([qw(AloneEncoder AloneDecoder)], |
| 690 | [qw(StreamEncoder StreamDecoder)], |
| 691 | [qw(RawEncoder RawDecoder)] , |
| 692 | [qw(EasyEncoder AutoDecoder)] , |
| 693 | ) |
| 694 | { |
| 695 | my $c = "Compress::Raw::Lzma::" . $class->[0]; |
| 696 | my $u = "Compress::Raw::Lzma::" . $class->[1]; |
| 697 | doitscip-perl cpan Compress-Raw-Lzma 2.224 main/doit(). $c, $u; |
| 698 | } |