8 die $@ if $@ and !is_miniperl();
13 [ '', 'zero-length' ],
15 [ '!a', 'bad first character' ],
16 [ 'a!', 'bad second character' ],
17 [ '@a', 'fencepost before A' ],
18 [ '[a', 'fencepost after Z' ],
19 [ '`a', 'fencepost before a' ],
20 [ '{a', 'fencepost after z' ],
21 [ '-a', 'fencepost before .' ],
22 [ ':a', 'fencepost after 9' ],
25 my @good_salts = qw(aa zz AA ZZ .. 99);
27 plan tests => 2 * @bad_salts + 1 + @good_salts;
29 for my $bad_salt (@bad_salts) {
30 my ($salt, $what) = @$bad_salt;
32 is(crypt("abc", $salt), undef, "bad salt ($what)");
33 is(0+$!, &Errno::EINVAL, "check errno ($what)");
36 is(crypt("abcdef", "ab"), "abDMWw5NL.afs", "sanity check result");
38 # just to check we're not rejecting any good salts
39 for my $good_salt (@good_salts) {
40 isnt(crypt("abcdef", $good_salt), undef, "good salt $good_salt");