lpush
[perl-Redis.git] / t / 01-Redis.t
index 7dad9f7..0eace15 100755 (executable)
@@ -3,7 +3,7 @@
 use warnings;
 use strict;
 
-use Test::More tests => 48;
+use Test::More tests => 55;
 
 use lib 'lib';
 
@@ -66,4 +66,24 @@ cmp_ok( $o->type('foo'), 'eq', 'string', 'type' );
 cmp_ok( $o->keys('key-*'), '==', $key_next + 1, 'key-*' );
 is_deeply( [ $o->keys('key-*') ], [ @keys ], 'keys' );
 
+ok( my $key = $o->randomkey, 'randomkey' );
+diag "key: $key";
+
+ok( $o->rename( 'test-incrby', 'test-renamed' ), 'rename' );
+ok( $o->exists( 'test-renamed' ), 'exists test-renamed' );
+
+eval { $o->rename( 'test-decrby', 'test-renamed', 1 ) };
+ok( $@, 'rename to existing key' );
+
+ok( my $nr_keys = $o->dbsize, 'dbsize' );
+diag "dbsize: $nr_keys";
+
+diag "Commands operating on lists";
+
+ok( $o->rpush( 'test-list' => 'foo' ), 'rpush' );
+
+ok( $o->lpush( 'test-list' => 'foo' ), 'lpush' );
+
+
+
 ok( $o->quit, 'quit' );