File: bug-localize-regex-vars.t

package info (click to toggle)
libcrypt-saltedhash-perl 0.09-3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, sid, trixie
  • size: 128 kB
  • sloc: perl: 128; makefile: 4
file content (22 lines) | stat: -rw-r--r-- 574 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
use strict;
use warnings;

use Test::More;
use Crypt::SaltedHash;
use Test::Fatal;

my $string = "+++linux";
$string =~ m/[+]*(.*)/;

is $1, 'linux', '$1 set to "linux"';

my $stored_password = '$PBKDF2$HMACSHA1:1000:bHV4ZW1idXJna0tB4/Lo9MtMLaGHOtY9ig==$sUKYw9mZ66E8fLL2w01Rq2EotiY=';
my $password = 'somepw';

my $return;
my $lives = exception { $return = Crypt::SaltedHash->validate( $stored_password, $password, undef ) };

is $lives,  undef, 'validate() lived even through non-match and $1 already set!';
ok !$return, 'validate() returns false properly';

done_testing;