File: 14-blacklist.t

package info (click to toggle)
libcrypt-random-seed-perl 0.03-3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 200 kB
  • sloc: perl: 448; makefile: 7
file content (19 lines) | stat: -rw-r--r-- 623 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
#!/usr/bin/env perl
use strict;
use warnings;
use Crypt::Random::Seed;

use Test::More  tests => 3;

# Expect croak if Only isn't an array reference
ok(!eval {Crypt::Random::Seed->new(Never=>0);}, "Only with non-array reference croaks");

# Find out what source it normally returns
my $source = Crypt::Random::Seed->new();
ok(defined $source, "Source found");
my $method = $source->name();

# Now blacklist that source
my $source2 = Crypt::Random::Seed->new(Never=>[$method]);
my $newmethod = (defined $source2) ? $source2->name() : "";
isnt($newmethod, $method, "Old method $method was blacklisted.  Chose '$newmethod'");