File: error.t

package info (click to toggle)
libauthen-radius-perl 0.33-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 460 kB
  • sloc: perl: 1,057; makefile: 4
file content (19 lines) | stat: -rw-r--r-- 690 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
use strict;
use warnings;
use Test::More tests => 9;
use Test::NoWarnings;

BEGIN { use_ok('Authen::Radius') };

my $auth = Authen::Radius->new(Host => '127.0.0.1', Secret => 'secret', Debug => 0);
$auth->set_error('ETIMEOUT', 'test timeout');
is($auth->get_error(), 'ETIMEOUT', 'error code');
is(Authen::Radius->get_error(), 'ETIMEOUT', 'global error code');
is($auth->strerror(), 'timed out waiting for packet', 'error message');
is($auth->error_comment(), 'test timeout', 'error comment');

# called by check_pwd()
ok( $auth->clear_attributes, 'clear attributes');

is($auth->get_error(), 'ENONE', 'error was reset');
is(Authen::Radius->get_error(), 'ENONE', 'global error also reset');