File: 04basic.t

package info (click to toggle)
libauthen-simple-passwd-perl 0.6-4.1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 120 kB
  • sloc: perl: 98; makefile: 3
file content (11 lines) | stat: -rw-r--r-- 715 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
use Test::More tests => 8;

use_ok('Authen::Simple::Passwd');

ok( my $passwd = Authen::Simple::Passwd->new( path => 't/etc/passwd' ) );
ok(   $passwd->authenticate( 'apr1',  'apr1'  ), 'Successfully authenticated using $apr1' );
ok(   $passwd->authenticate( 'crypt', 'crypt' ), 'Successfully authenticated using crypt() with Traditional DES' );
ok(   $passwd->authenticate( 'md5',   'md5'   ), 'Successfully authenticated using $1$' );
ok(   $passwd->authenticate( 'plain', 'plain' ), 'Successfully authenticated using plain' );
ok(   $passwd->authenticate( 'sha',   'sha'   ), 'Successfully authenticated using {SHA}' );
ok( ! $passwd->authenticate( '-',     '-'     ), 'Usernames with hyphens is not allowed' );