File: 04fatal.t

package info (click to toggle)
libstring-mkpasswd-perl 0.05-1
  • links: PTS, VCS
  • area: main
  • in suites: buster, jessie, jessie-kfreebsd, stretch
  • size: 140 kB
  • ctags: 22
  • sloc: perl: 272; makefile: 2
file content (20 lines) | stat: -rw-r--r-- 426 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
use Test::More tests => 5;
BEGIN { use_ok('String::MkPasswd') };

String::MkPasswd->import("mkpasswd");

$String::MkPasswd::FATAL = 0;

eval { mkpasswd(-fatal => 1) };
is($@, "", "not fatal, flag");

eval { mkpasswd(-length => 1, -fatal => 1) };
isnt($@, "", "fatal, flag");

$String::MkPasswd::FATAL = 1;

eval { mkpasswd() };
is($@, "", "not fatal, global");

eval { mkpasswd(-length => 1) };
isnt($@, "", "fatal, global");