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