--- t/20-Redis-Hash.t 2009/03/22 19:17:51 42 +++ t/20-Redis-Hash.t 2009/03/23 09:22:30 44 @@ -11,20 +11,20 @@ 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( [ sort 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 );