X-Git-Url: http://git.rot13.org/?p=perl-Redis.git;a=blobdiff_plain;f=t%2F01-Redis.t;h=d478a7b5a6bea52082368c5186956e9ff9c136c8;hp=714c898c80315fe5231ec500f0afd42d8eeae2af;hb=0530ee25184daf62214ddb3b281cb806aff7f9db;hpb=d83b94045bd5ac5764d26319e03d1ee6c4266e63;ds=sidebyside diff --git a/t/01-Redis.t b/t/01-Redis.t index 714c898..d478a7b 100755 --- a/t/01-Redis.t +++ b/t/01-Redis.t @@ -3,7 +3,7 @@ use warnings; use strict; -use Test::More tests => 62; +use Test::More tests => 69; use lib 'lib'; @@ -88,11 +88,21 @@ 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' ); -ok( $o->ltrim( $list, 2, 3 ), 'ltrim' ); +ok( $o->ltrim( $list, 1, 2 ), 'ltrim' ); 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' ); + ok( $o->quit, 'quit' );