File: IsBadPasswordChar.t

package info (click to toggle)
libdata-password-perl 1.12-3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 108 kB
  • sloc: perl: 123; makefile: 2
file content (32 lines) | stat: -rw-r--r-- 949 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# Before `make install' is performed this script should be runnable with
# `make test'. After `make install' it should work as `perl test.pl'

###################################################################
use Test::More qw(no_plan);

use Data::Password qw(IsBadPassword $MAXLEN @DICTIONARIES $SKIPCHAR $BADCHARS);

ok(1,'Module Loaded');

{
      my $pass = "\0BC2f4a";
      my $reason = IsBadPassword($pass) || '';
      ok($reason ,"$pass: $reason");
      $SKIPCHAR = 1;
      my $reason = IsBadPassword($pass) || '';
      ok(! $reason ,"$pass: $reason");
      $SKIPCHAR = 0;
}

{
      $SKIPCHAR = 0;
      my $pass = "0BC2f4a";
      my $reason = IsBadPassword($pass) || '';
      ok(! $reason ,"$pass: $reason");
      $BADCHARS = '^A-Z1-9';
      $reason = IsBadPassword($pass) || '';
      ok($reason ,"$pass: $reason");
      $pass = "BCAFDQ11";
      $reason = IsBadPassword($pass) || '';
      ok(! $reason ,"$pass: $reason");
}