Debian Codegraph @

t/misc.t

raw
1 use Test::More tests => 12;
2 use strict;
3 use lib 't';
4 use_ok('Test::Qpsmtpd');
5
6 ok(my ($smtpd, $conn) = Test::Qpsmtpd->new_conn(), "get new connection");
7
8 # fault method
9 is(($smtpd->fault)->[0], 451, 'fault returns 451');
10 is(($smtpd->fault("test message"))->[1],
11 "Internal error - try again later - test message",
12 'returns the input message');
13
14 # vrfy command
15 is(($smtpd->command('VRFY <foo@bar>'))[0], 252, 'VRFY command');
16
17 # plugins/count_unrecognized_commands
18 is(($smtpd->command('nonsense'))[0], 500, 'bad command 1');
19 is(($smtpd->command('nonsense'))[0], 500, 'bad command 2');
20 is(($smtpd->command('nonsense'))[0], 500, 'bad command 3');
21 is(($smtpd->command('nonsense'))[0], 521, 'bad command 4');
22