File: random.salt.t

package info (click to toggle)
libcrypt-passwdmd5-perl 1.42-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 128 kB
  • sloc: perl: 125; makefile: 2
file content (26 lines) | stat: -rw-r--r-- 463 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
use strict;
use warnings;

use Crypt::PasswdMD5 'random_md5_salt';

use Test::More;

# ------------------------------------------------

sub length_is
{
	my $in   = shift;
	my $out  = shift;
	my $salt = random_md5_salt($in);

	ok($out == length($salt), "random_md5_salt(). Input: $in. Output length: $out");

} # End of length_is.

# ------------------------------------------------

length_is($_, $_) for (1..8);
length_is(0, 8);
length_is(9, 8);

done_testing;