X-Git-Url: http://git.rot13.org/?p=perl-Redis.git;a=blobdiff_plain;f=t%2F20-Redis-Hash.t;h=687b85c1ee28631d5a3bfbf515b3264664eb5f5f;hp=4bef8a54748338b22aacc909c152f0e10f626d69;hb=d614f74a89501c756b5e6a240995c0aa0295573b;hpb=16b05e03b2a90f65f103553d934858d974ee808d diff --git a/t/20-Redis-Hash.t b/t/20-Redis-Hash.t index 4bef8a5..687b85c 100755 --- a/t/20-Redis-Hash.t +++ b/t/20-Redis-Hash.t @@ -11,20 +11,20 @@ BEGIN { use_ok( 'Redis::Hash' ); } -my $h; - -ok( my $o = tie( %$h, 'Redis::Hash', 'test-redis-hash' ), 'tie' ); +ok( my $o = tie( my %h, 'Redis::Hash', 'test-redis-hash' ), 'tie' ); isa_ok( $o, 'Redis::Hash' ); -$h = {}; +$o->CLEAR(); + +ok( ! keys %h, 'empty' ); + +ok( %h = ( 'foo' => 42, 'bar' => 1, 'baz' => 99 ), '=' ); -ok( ! %$h, 'empty' ); +is_deeply( [ keys %h ], [ 'bar', 'baz', 'foo' ], 'keys' ); -ok( $h = { 'foo' => 42, 'bar' => 1, 'baz' => 99 }, '=' ); +is_deeply( \%h, { bar => 1, baz => 99, foo => 42, }, 'structure' ); -is_deeply( $h, { bar => 1, baz => 99, foo => 42 }, 'values' ); -is_deeply( [ keys %$h ], [ 'bar', 'baz', 'foo' ], 'keys' ); +diag dump( \%h ); -diag dump( $h );