/[Redis.pre-github]/t/20-Redis-Hash.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 /t/20-Redis-Hash.t

Parent Directory Parent Directory | Revision Log Revision Log


Revision 63 - (hide annotations)
Mon Sep 14 11:37:25 2009 UTC (10 years, 6 months ago) by dpavlin
File MIME type: application/x-troff
File size: 533 byte(s)
use Data::Dumper instead of Data::Dump so all our dependencies are perl core modules
1 dpavlin 42 #!/usr/bin/perl
2    
3     use warnings;
4     use strict;
5    
6 dpavlin 59 use Test::More tests => 8;
7 dpavlin 42 use lib 'lib';
8    
9     BEGIN {
10     use_ok( 'Redis::Hash' );
11     }
12    
13 dpavlin 43 ok( my $o = tie( my %h, 'Redis::Hash', 'test-redis-hash' ), 'tie' );
14 dpavlin 42
15     isa_ok( $o, 'Redis::Hash' );
16    
17 dpavlin 43 $o->CLEAR();
18 dpavlin 42
19 dpavlin 43 ok( ! keys %h, 'empty' );
20 dpavlin 42
21 dpavlin 43 ok( %h = ( 'foo' => 42, 'bar' => 1, 'baz' => 99 ), '=' );
22 dpavlin 42
23 dpavlin 44 is_deeply( [ sort keys %h ], [ 'bar', 'baz', 'foo' ], 'keys' );
24 dpavlin 42
25 dpavlin 43 is_deeply( \%h, { bar => 1, baz => 99, foo => 42, }, 'structure' );
26 dpavlin 42
27 dpavlin 59 ok( my $mem = $o->info->{used_memory}, 'info' );
28     diag "used memory $mem";
29 dpavlin 43

Properties

Name Value
svn:executable *

  ViewVC Help
Powered by ViewVC 1.1.26