2
# $File: //member/autrijus/Module-Signature/t/0-signature.t $ $Author: autrijus $
3
# $Revision: #5 $ $Change: 7212 $ $DateTime: 2003/07/28 14:21:21 $
6
use Test::More tests => 1;
6
if (!eval { require Module::Signature; 1 }) {
8
"Next time around, consider installing Module::Signature, ".
9
"so you can verify the integrity of this distribution.";
11
elsif ( !-e 'SIGNATURE' ) {
12
plan skip_all => "SIGNATURE not found";
14
elsif ( -s 'SIGNATURE' == 0 ) {
15
plan skip_all => "SIGNATURE file empty";
17
elsif (!eval { require Socket; Socket::inet_aton('subkeys.pgp.net') }) {
18
plan skip_all => "Cannot connect to the keyserver to check module ".
25
my $ret = Module::Signature::verify();
9
if (!eval { require Module::Signature; 1 }) {
10
skip("Next time around, consider install Module::Signature, ".
11
"so you can verify the integrity of this distribution.", 1);
13
elsif (!eval { require Socket; Socket::inet_aton('pgp.mit.edu') }) {
14
skip("Cannot connect to the keyserver", 1);
17
ok(Module::Signature::verify() == Module::Signature::SIGNATURE_OK()
18
=> "Valid signature" );
27
skip "Module::Signature cannot verify", 1
28
if $ret eq Module::Signature::CANNOT_VERIFY();
30
cmp_ok $ret, '==', Module::Signature::SIGNATURE_OK(), "Valid signature";