/[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 46 - (hide annotations)
Mon Mar 23 11:30:29 2009 UTC (15 years ago) by dpavlin
File MIME type: application/x-troff
File size: 504 byte(s)
comment debug output

1 dpavlin 42 #!/usr/bin/perl
2    
3     use warnings;
4     use strict;
5    
6     use Test::More tests => 7;
7     use lib 'lib';
8     use Data::Dump qw/dump/;
9    
10     BEGIN {
11     use_ok( 'Redis::Hash' );
12     }
13    
14 dpavlin 43 ok( my $o = tie( my %h, 'Redis::Hash', 'test-redis-hash' ), 'tie' );
15 dpavlin 42
16     isa_ok( $o, 'Redis::Hash' );
17    
18 dpavlin 43 $o->CLEAR();
19 dpavlin 42
20 dpavlin 43 ok( ! keys %h, 'empty' );
21 dpavlin 42
22 dpavlin 43 ok( %h = ( 'foo' => 42, 'bar' => 1, 'baz' => 99 ), '=' );
23 dpavlin 42
24 dpavlin 44 is_deeply( [ sort keys %h ], [ 'bar', 'baz', 'foo' ], 'keys' );
25 dpavlin 42
26 dpavlin 43 is_deeply( \%h, { bar => 1, baz => 99, foo => 42, }, 'structure' );
27 dpavlin 42
28 dpavlin 43
29 dpavlin 46 #diag dump( \%h );
30 dpavlin 43

Properties

Name Value
svn:executable *

  ViewVC Help
Powered by ViewVC 1.1.26