]>
git.saurik.com Git - redis.git/blob - client-libraries/perl/t/20-Redis-Hash.t
6 use Test
::More tests
=> 7;
8 use Data
::Dump qw
/dump/;
11 use_ok
( 'Redis::Hash' );
14 ok
( my $o = tie
( my %h, 'Redis::Hash', 'test-redis-hash' ), 'tie' );
16 isa_ok
( $o, 'Redis::Hash' );
20 ok
( ! keys %h, 'empty' );
22 ok
( %h = ( 'foo' => 42, 'bar' => 1, 'baz' => 99 ), '=' );
24 is_deeply
( [ sort keys %h ], [ 'bar', 'baz', 'foo' ], 'keys' );
26 is_deeply
( \
%h, { bar
=> 1, baz
=> 99, foo
=> 42, }, 'structure' );