File: 009_exception_handling.t

package info (click to toggle)
libdancer2-plugin-passphrase-perl 3.4.1-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 168 kB
  • sloc: perl: 190; makefile: 2
file content (16 lines) | stat: -rw-r--r-- 467 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use Test::More tests => 2;

use strict;
use warnings;

use Dancer2;
use Dancer2::Plugin::Passphrase;

my $secret = "Super Secret Squirrel";

eval { passphrase($secret)->matches('not an rfc2307 string') };
like $@, qr/An RFC 2307 compliant string must be passed to matches/i, 'Dies on invalid RFC 2307 string';


eval { passphrase($secret)->matches('{CRYPT}$ Almost $ An RFC 2307 String') };
like $@, qr/Unknown CRYPT format/i, 'Dies on almost valid RFC 2307 string';