X-Git-Url: http://git.rot13.org//?a=blobdiff_plain;f=t%2F01-Redis.t;h=b12e727cf0a44e2da94bd00a9371e6bf01e8507e;hb=776f1916034f293af03303fb23d65c04c62ec352;hp=177cacf50cbb0edc4bf2cd942f4a45968428dbcc;hpb=f5a339e21d14df3ad2b9377f92aa503e35ec7dcf;p=perl-Redis.git diff --git a/t/01-Redis.t b/t/01-Redis.t index 177cacf..b12e727 100755 --- a/t/01-Redis.t +++ b/t/01-Redis.t @@ -3,7 +3,7 @@ use warnings; use strict; -use Test::More tests => 102; +use Test::More tests => 103; use lib 'lib'; @@ -15,6 +15,7 @@ ok( my $o = Redis->new(), 'new' ); ok( $o->ping, 'ping' ); + diag "Commands operating on string values"; ok( $o->set( foo => 'bar' ), 'set foo => bar' ); @@ -77,7 +78,6 @@ 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' ); @@ -86,7 +86,7 @@ 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"; @@ -162,6 +162,7 @@ ok( $o->exists( 'foo' ), 'exists' ); ok( $o->flushdb, 'flushdb' ); cmp_ok( $o->dbsize, '==', 0, 'empty' ); + diag "Sorting"; ok( $o->lpush( 'test-sort', $_ ), "put $_" ) foreach ( 1 .. 4 ); @@ -170,6 +171,12 @@ cmp_ok( $o->llen( 'test-sort' ), '==', 4, 'llen' ); is_deeply( [ $o->sort( 'test-sort' ) ], [ 1,2,3,4 ], 'sort' ); is_deeply( [ $o->sort( 'test-sort DESC' ) ], [ 4,3,2,1 ], 'sort DESC' ); + +diag "Persistence control commands"; + +ok( $o->save, 'save' ); + + diag "Connection handling"; ok( $o->quit, 'quit' );