]>
iEval git - app-edwardng.git/blob - t/App-EdwardNG.t
5 use constant KEYID
=> '34B22806';
6 use constant EMAIL
=> 'EdwardNG (Key for testing EdwardNG) <edwardng@ieval.ro>';
8 use Test
::More tests
=> 19;
9 BEGIN { use_ok
('App::EdwardNG') };
10 $ENV{EDWARDNG_DEBUG
} = $ENV{TEST_VERBOSE
};
11 $ENV{EDWARDNG_KEYDIR
} = 't/keydir';
16 my ($name, $expected) = @_;
17 ($tmpl, %params) = App
::EdwardNG
::process_message
("t/data/$name");
18 is
$tmpl, $expected, "Result for $name is $expected" or diag
"GnuPG said: $params{message}"
21 process
'mime-signed', 'sign';
22 is
$params{keyid
}, KEYID
, 'mime-signed keyid';
23 is
$params{email
}, EMAIL
, 'mime-signed email';
25 process
'mime-encrypted', 'encrypt';
26 like
$params{plaintext
}, qr/MIME encrypted/, 'mime-signed plaintext';
28 process
'mime-signed-encrypted', 'signencrypt';
29 is
$params{keyid
}, KEYID
, 'mime-signed-encrypted keyid';
30 is
$params{email
}, EMAIL
, 'mime-signed-encrypted email';
31 like
$params{plaintext
}, qr/MIME signed & encrypted/, 'mime-signed-encrypted plaintext';
33 process
'inline-signed', 'sign';
34 is
$params{keyid
}, KEYID
, 'inline-signed keyid';
35 is
$params{email
}, EMAIL
, 'inline-signed email';
37 process
'inline-encrypted', 'encrypt';
38 like
$params{plaintext
}, qr/Inline encrypted/, 'inline-signed plaintext';
40 process
'inline-signed-encrypted', 'signencrypt';
41 is
$params{keyid
}, KEYID
, 'inline-signed-encrypted keyid';
42 is
$params{email
}, EMAIL
, 'inline-signed-encrypted email';
43 like
$params{plaintext
}, qr/Inline signed & encrypted/, 'inline-signed-encrypted plaintext';
This page took 0.0528 seconds and 4 git commands to generate.