/[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

Contents of /t/20-Redis-Hash.t

Parent Directory Parent Directory | Revision Log Revision Log


Revision 63 - (show annotations)
Mon Sep 14 11:37:25 2009 UTC (14 years, 7 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 #!/usr/bin/perl
2
3 use warnings;
4 use strict;
5
6 use Test::More tests => 8;
7 use lib 'lib';
8
9 BEGIN {
10 use_ok( 'Redis::Hash' );
11 }
12
13 ok( my $o = tie( my %h, 'Redis::Hash', 'test-redis-hash' ), 'tie' );
14
15 isa_ok( $o, 'Redis::Hash' );
16
17 $o->CLEAR();
18
19 ok( ! keys %h, 'empty' );
20
21 ok( %h = ( 'foo' => 42, 'bar' => 1, 'baz' => 99 ), '=' );
22
23 is_deeply( [ sort keys %h ], [ 'bar', 'baz', 'foo' ], 'keys' );
24
25 is_deeply( \%h, { bar => 1, baz => 99, foo => 42, }, 'structure' );
26
27 ok( my $mem = $o->info->{used_memory}, 'info' );
28 diag "used memory $mem";
29

Properties

Name Value
svn:executable *

  ViewVC Help
Powered by ViewVC 1.1.26