/[Sack]/trunk/t/Sack-Digest.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

Contents of /trunk/t/Sack-Digest.t

Parent Directory Parent Directory | Revision Log Revision Log


Revision 36 - (show annotations)
Wed Sep 23 22:22:18 2009 UTC (14 years, 7 months ago) by dpavlin
File MIME type: application/x-troff
File size: 723 byte(s)
undigest_out, document digest key names, version bump [0.03]
1 #!/usr/bin/perl
2
3 use Test::More tests => 14;
4 use Data::Dump qw(dump);
5
6 use lib 'lib';
7
8 BEGIN {
9 use_ok( 'Sack::Digest' );
10 }
11
12 ok( Sack::Digest->clean, 'clean' );
13
14 ok( my $o = Sack::Digest->open( 0 ), 'open' );
15
16 foreach my $full ( 'foo', 'bar', 'baz' ) {
17
18 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
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