The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.
#!/usr/bin/perl

use strict;
use warnings;
use Test::More;
use Test::Exception;

use Crypt::Juniper;

my $warn = 0;

my @invalid = (undef, qw[ $9jadsfdf $9$asd $9$asdf*
                          $9$dLw2ajHmFnCZUnCtuEhVwYY
                          $9$dLw2ajHmFnCZUnCtuEhVw  ]);
plan tests => scalar @invalid;

for my $crypt (@invalid)
{
    # avoid undef interpolation without disabling warnings
    my $print = defined $crypt ? "'$crypt'" : 'undef';
    dies_ok { juniper_decrypt($crypt) } "Invalid crypt '$print' should return undef";
}