_sock_ok();
}
+=head2 dbsize
+
+ my $nr_keys = $r->dbsize;
+
+=cut
+
+sub dbsize {
+ my ( $self ) = @_;
+ print $sock "DBSIZE\r\n";
+ _sock_result();
+}
+
=head1 AUTHOR
Dobrica Pavlinusic, C<< <dpavlin at rot13.org> >>
use warnings;
use strict;
-use Test::More tests => 52;
+use Test::More tests => 53;
use lib 'lib';
eval { $o->rename( 'test-decrby', 'test-renamed', 1 ) };
ok( $@, 'rename to existing key' );
+ok( my $nr_keys = $o->dbsize, 'dbsize' );
+diag "dbsize: $nr_keys";
+
ok( $o->quit, 'quit' );