File: 003_default_settings.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 (12 lines) | stat: -rw-r--r-- 430 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
use strict;
use warnings;
use Test::More tests => 3;
use Dancer2;
use Dancer2::Plugin::Passphrase;

my $secret  = "Super Secret Squirrel";
my $rfc2307 = passphrase($secret)->generate->rfc2307;

like($rfc2307, qr/^{CRYPT}\$2a\$04\$/,      'RFC compliant hash generated');
ok(passphrase($secret)->matches($rfc2307),  'Match plaintext to hash');
ok(!passphrase('WRONG')->matches($rfc2307), 'Incorrect passwords should be rejected');