X-Git-Url: http://git.rot13.org/?p=perl-Redis.git;a=blobdiff_plain;f=t%2F01-Redis.t;h=30d780dc78003a643da26c2ce5c3f4667ec42c70;hp=d41bd3f7f9144c67e884a2daabd622b9875d8b53;hb=7b06790912537232a106266ab3777d548f86cfd3;hpb=7b6138898abd509437714737a314e455f77bc1e5;ds=sidebyside diff --git a/t/01-Redis.t b/t/01-Redis.t index d41bd3f..30d780d 100755 --- a/t/01-Redis.t +++ b/t/01-Redis.t @@ -3,7 +3,7 @@ use warnings; use strict; -use Test::More tests => 64; +use Test::More tests => 71; use lib 'lib'; @@ -88,6 +88,7 @@ ok( $o->rpush( $list => "r$_" ), 'rpush' ) foreach ( 1 .. 3 ); ok( $o->lpush( $list => "l$_" ), 'lpush' ) foreach ( 1 .. 2 ); +cmp_ok( $o->type($list), 'eq', 'list', 'type' ); cmp_ok( $o->llen($list), '==', 5, 'llen' ); is_deeply( [ $o->lrange( $list, 0, 1 ) ], [ 'l2', 'l1' ], 'lrange' ); @@ -98,4 +99,14 @@ cmp_ok( $o->llen($list), '==', 2, 'llen after ltrim' ); cmp_ok( $o->lindex( $list, 0 ), 'eq', 'l1', 'lindex' ); cmp_ok( $o->lindex( $list, 1 ), 'eq', 'r1', 'lindex' ); +ok( $o->lset( $list, 0, 'foo' ), 'lset' ); +cmp_ok( $o->lindex( $list, 0 ), 'eq', 'foo', 'verified' ); + +ok( $o->lrem( $list, 1, 'foo' ), 'lrem' ); +cmp_ok( $o->llen( $list ), '==', 1, 'llen after lrem' ); + +cmp_ok( $o->lpop( $list ), 'eq', 'r1', 'lpop' ); + +ok( ! $o->rpop( $list ), 'rpop' ); + ok( $o->quit, 'quit' );