diff options
author | Lorry Tar Creator <lorry-tar-importer@lorry> | 2015-07-31 18:59:09 +0000 |
---|---|---|
committer | Lorry Tar Creator <lorry-tar-importer@lorry> | 2015-07-31 18:59:09 +0000 |
commit | 42c8b23669eac442a303190dad44d78cea63cf59 (patch) | |
tree | 1cc49a1a1813bd802988e88058f353a4e0a23514 /t/16_decrypt.t | |
download | Archive-Zip-tarball-42c8b23669eac442a303190dad44d78cea63cf59.tar.gz |
Archive-Zip-1.49HEADArchive-Zip-1.49master
Diffstat (limited to 't/16_decrypt.t')
-rw-r--r-- | t/16_decrypt.t | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/t/16_decrypt.t b/t/16_decrypt.t new file mode 100644 index 0000000..2e5f32f --- /dev/null +++ b/t/16_decrypt.t @@ -0,0 +1,23 @@ +#!/usr/bin/perl + +use strict; +use warnings; + +BEGIN { $| = 1; } + +use Archive::Zip qw( :ERROR_CODES ); +use Test::More; + +my $zip = Archive::Zip->new(); +isa_ok($zip, "Archive::Zip"); +is($zip->read("t/data/crypcomp.zip"), AZ_OK, "Read file"); + +ok(my @mn = $zip->memberNames, "get memberNames"); +is_deeply(\@mn, ["test"], "memberNames"); +ok(my $m = $zip->memberNamed($mn[0]), "find member"); +isa_ok($m, "Archive::Zip::Member"); + +is($m->password("test"), "test", "correct password"); +is($m->contents, "encryption test\n" x 100, "Decoded buffer"); + +done_testing; |