File: verify.t

package info (click to toggle)
libmime-lite-perl 3.033-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 660 kB
  • sloc: perl: 1,848; makefile: 9
file content (24 lines) | stat: -rw-r--r-- 569 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/usr/bin/perl
use lib "lib", "t";
use MIME::Lite;
use Test::More tests => 2;
use Utils;

$MIME::Lite::VANILLA  = 1;
$MIME::Lite::PARANOID = 1;

my $msg;

$msg  = MIME::Lite->new(From => "me", To => "you");
$msg->attach(Path => "boguscmd |");
$msg->attach(Data => "Hello");
$msg->attach(Path => "<path.to.missing.file");
eval { $msg->verify_data };

like($@, qr/path\.to\.missing\.file/, "we detected a missing file");

$msg  = MIME::Lite->new(From=>"me", To=>"you");
$msg->attach(Data => "Hello");
eval { $msg->verify_data };

ok(!$@, "we detected NO missing file");