File: digest.t

package info (click to toggle)
libkiokudb-perl 0.57-3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 1,396 kB
  • sloc: perl: 13,314; makefile: 12
file content (39 lines) | stat: -rw-r--r-- 773 bytes parent folder | download | duplicates (2)
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#!/usr/bin/perl

use strict;
use warnings;

use Test::More;

use KiokuDB::Test::Digested;

my $foo = KiokuDB::Test::Digested->new(
    foo => "blaitty4",
);

ok( $foo->digest, "got a digest" );

my $bar = KiokuDB::Test::Digested->new(
    bar => "bar",
);

ok( $bar->digest, "got a digest" );

isnt( $foo->digest, $bar->digest, "digests differ" );

my $both = KiokuDB::Test::Digested->new(
    foo => "blaitty4",
    bar => "bar",
);

isnt( $both->digest, $foo->digest, "digests differ" );
isnt( $both->digest, $bar->digest, "digests differ" );

is( $foo->digest, KiokuDB::Test::Digested->new( foo => "blaitty4" )->digest, "digest is the same for new object" );

use Data::Dumper;

like( Dumper($foo->digest_parts), qr/blaitty4/, "contains digest parts" );


done_testing;