/[Sack]/trunk/t/Sack-Digest-BerkeleyDB.t
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Annotation of /trunk/t/Sack-Digest-BerkeleyDB.t

Parent Directory Parent Directory | Revision Log Revision Log


Revision 36 - (hide annotations)
Wed Sep 23 22:22:18 2009 UTC (14 years, 9 months ago) by dpavlin
Original Path: trunk/t/Sack-Digest.t
File MIME type: application/x-troff
File size: 723 byte(s)
undigest_out, document digest key names, version bump [0.03]
1 dpavlin 33 #!/usr/bin/perl
2    
3 dpavlin 34 use Test::More tests => 14;
4 dpavlin 36 use Data::Dump qw(dump);
5 dpavlin 33
6     use lib 'lib';
7    
8     BEGIN {
9     use_ok( 'Sack::Digest' );
10     }
11    
12 dpavlin 34 ok( Sack::Digest->clean, 'clean' );
13    
14 dpavlin 33 ok( my $o = Sack::Digest->open( 0 ), 'open' );
15    
16 dpavlin 34 foreach my $full ( 'foo', 'bar', 'baz' ) {
17 dpavlin 33
18 dpavlin 34 ok( my $nr = Sack::Digest->to_int( $full ), "to_int $full" );
19     ok( $nr =~ m/^\d+$/, 'int' );
20    
21     cmp_ok( Sack::Digest->from_int( $nr ), 'eq', $full, "from_int $nr" );
22    
23     }
24    
25     cmp_ok( Sack::Digest->from_int( 42 ), '==', 42, 'from_int missing' );
26    
27     ok( Sack::Digest->close, 'close' );
28 dpavlin 36
29     ok( Sack::Digest->open(0), 'open again' );
30    
31     my $out = {
32     "CR#+" => { 1=>1, 2=>1, 3=>1, 4=>1, 5=>1 }
33     };
34    
35     ok( my $full = Sack::Digest->undigest_out( $out ), 'undigest_out' );
36     diag dump $full;
37    

Properties

Name Value
svn:executable *

  ViewVC Help
Powered by ViewVC 1.1.26