File: clone.t

package info (click to toggle)
libdigest-whirlpool-perl 1.09-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 448 kB
  • sloc: ansic: 1,646; perl: 175; makefile: 51
file content (25 lines) | stat: -rw-r--r-- 621 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
use strict;

use Test::More tests => 3;

use Digest::Whirlpool;

my $whirlpool = new Digest::Whirlpool;

$whirlpool->add("a");

my $whirlpool2 = $whirlpool->clone;
like $whirlpool->hexdigest, qr/^8aca/;

# do this after the digest above to make sure we're not just
# pointing to the same memory location

$whirlpool2->add( "bc" ); # abc
my $whirlpool3 = $whirlpool2->clone->clone->clone; # chaned cloning
like $whirlpool2->hexdigest, qr/^4e24/;

# do this after the digest above to make sure we're not just
# pointing to the same memory location

$whirlpool3->add( "de" ); # abcde
like $whirlpool3->hexdigest, qr/^5d74/;