File: util-easy.t

package info (click to toggle)
libemail-sender-perl 2.601-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 468 kB
  • sloc: perl: 2,276; makefile: 2
file content (32 lines) | stat: -rw-r--r-- 608 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!perl
use strict;
use warnings;
use Test::More;

use Email::Sender::Util;

my $BASE = 'Email::Sender::Transport::';
sub with_base { "$BASE" . $_[0] }

my @rewrite = qw(  SMTP );
my @untouch = qw( =SMTP SMTP::Persistent =SMTP::Persistent );

for my $class (@rewrite) {
  is(
    Email::Sender::Util->_rewrite_class($class),
    with_base($class),
    "we do rewrite easy-transport class $class",
  );
}

for my $class (@untouch) {
  (my $no_eq = $class) =~ s/^=//;

  is(
    Email::Sender::Util->_rewrite_class($class),
    $no_eq,
    "we do NOT rewrite easy-transport class $class",
  );
}

done_testing;