From: Dobrica Pavlinusic Date: Wed, 17 Jun 2009 16:49:17 +0000 (+0000) Subject: document and test redis object for issuing normal commands X-Git-Tag: 0.0801~4 X-Git-Url: http://git.rot13.org/?p=perl-Redis.git;a=commitdiff_plain;h=3f297ca22758930ab7ad8ea5991350791ae67437;hp=223e1a0a42ff4f4de939abd88633ea3cc213f92b document and test redis object for issuing normal commands git-svn-id: svn+ssh://llin/home/dpavlin/private/svn/Redis@59 447b33ff-793d-4489-8442-9bea7d161be5 --- diff --git a/lib/Redis/Hash.pm b/lib/Redis/Hash.pm index e5f8f70..d85e71f 100644 --- a/lib/Redis/Hash.pm +++ b/lib/Redis/Hash.pm @@ -16,6 +16,9 @@ Redis::Hash - tie perl hashes into Redis tie %name, 'Redis::Hash', 'prefix'; + my $o = tie %foobar, 'Redis::Hash', 'foobar'; + print $o->info->{used_memory}; # or any redis command + =cut # mandatory methods diff --git a/t/20-Redis-Hash.t b/t/20-Redis-Hash.t index 7bd9daf..660c8f3 100755 --- a/t/20-Redis-Hash.t +++ b/t/20-Redis-Hash.t @@ -3,7 +3,7 @@ use warnings; use strict; -use Test::More tests => 7; +use Test::More tests => 8; use lib 'lib'; use Data::Dump qw/dump/; @@ -25,6 +25,6 @@ is_deeply( [ sort keys %h ], [ 'bar', 'baz', 'foo' ], 'keys' ); is_deeply( \%h, { bar => 1, baz => 99, foo => 42, }, 'structure' ); - -#diag dump( \%h ); +ok( my $mem = $o->info->{used_memory}, 'info' ); +diag "used memory $mem";