5 use File::Temp qw/tempdir/;
6 use Test::More tests => 7;
7 BEGIN { $ENV{AAP_ROOTDIR} = tempdir CLEANUP => 1 }
8 BEGIN { use_ok('Apache2::Authen::Passphrase', qw/pwset pwcheck/) };
11 my ($user, $pass, $testname) = @_;
12 eval { pwcheck $user, $pass };
17 my ($user, $pass, $testname) = @_;
18 eval { pwcheck $user, $pass };
19 isnt $@, '', $testname;
22 pwset marius => 'password';
23 pw_ok marius => 'password', 'Set password and check it';
24 pw_nok marius => 'anotherpassword', 'Check an incorrect password';
26 pwset marius => 'anotherpassword';
27 pw_ok marius => 'anotherpassword', 'Change the password and check it';
29 pw_nok 'BadUsername++', 'a', 'Bad username';
30 pw_nok 'a', 'a', 'Short username';
31 pw_nok 'asfwe0g3girg4ih45jho45ih45hi45h045jh4oh', 'a', 'Long username';