]> iEval git - app-edwardng.git/blame - t/App-EdwardNG.t
Fix recursive first_part
[app-edwardng.git] / t / App-EdwardNG.t
CommitLineData
2f9e679a
MG
1#!/usr/bin/perl -w
2use strict;
3use warnings;
4
5use constant KEYID => '34B22806';
6use constant EMAIL => 'EdwardNG (Key for testing EdwardNG) <edwardng@ieval.ro>';
7
8use Test::More tests => 19;
9BEGIN { use_ok('App::EdwardNG') };
10$ENV{EDWARDNG_DEBUG} = $ENV{TEST_VERBOSE};
11$ENV{EDWARDNG_KEYDIR} = 't/keydir';
12
13my ($tmpl, %params);
14
15sub process {
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}"
19}
20
21process 'mime-signed', 'sign';
22is $params{keyid}, KEYID, 'mime-signed keyid';
23is $params{email}, EMAIL, 'mime-signed email';
24
25process 'mime-encrypted', 'encrypt';
26like $params{plaintext}, qr/MIME encrypted/, 'mime-signed plaintext';
27
28process 'mime-signed-encrypted', 'signencrypt';
29is $params{keyid}, KEYID, 'mime-signed-encrypted keyid';
30is $params{email}, EMAIL, 'mime-signed-encrypted email';
31like $params{plaintext}, qr/MIME signed & encrypted/, 'mime-signed-encrypted plaintext';
32
33process 'inline-signed', 'sign';
34is $params{keyid}, KEYID, 'inline-signed keyid';
35is $params{email}, EMAIL, 'inline-signed email';
36
37process 'inline-encrypted', 'encrypt';
38like $params{plaintext}, qr/Inline encrypted/, 'inline-signed plaintext';
39
40process 'inline-signed-encrypted', 'signencrypt';
41is $params{keyid}, KEYID, 'inline-signed-encrypted keyid';
42is $params{email}, EMAIL, 'inline-signed-encrypted email';
43like $params{plaintext}, qr/Inline signed & encrypted/, 'inline-signed-encrypted plaintext';
This page took 0.02915 seconds and 4 git commands to generate.